127127``` ShellSession
128128pip install -U poe-api-wrapper
129129```
130- Or you can install a proxy-support version of this library for ** Python 3.9+**
130+ Or you can install auto-proxy version of this library for ** Python 3.9+**
131131``` ShellSession
132132pip install -U 'poe-api-wrapper[proxy]'
133133```
@@ -168,38 +168,39 @@ poe -b P-B_HERE -lat P-LAT_HERE -f FORMKEY_HERE
168168
169169## 🦄 Documentation
170170### Available Default Bots
171- | Display Name | Model | Token Limit | Words | Access Type |
172- | ---------------------- | ------------------------- | ----------- | ----- | --------------------------------------------------------------- |
173- | Assistant | capybara | 4K | 3K | ![ Free] ( https://img.shields.io/badge/free-2feb7a ) |
174- | Claude-3.5-Sonnet | claude_3_igloo | 4K | 3K | ![ Free] ( https://img.shields.io/badge/free-2feb7a ) |
175- | Claude-3-Opus | claude_2_1_cedar | 4K | 3K | ![ Subscriber] ( https://img.shields.io/badge/subscriber-fc4747 ) |
176- | Claude-3-Sonnet | claude_2_1_bamboo | 4K | 3K | ![ Free] ( https://img.shields.io/badge/free-2feb7a ) |
177- | Claude-3-Haiku | claude_3_haiku | 4K | 3K | ![ Free] ( https://img.shields.io/badge/free-2feb7a ) |
178- | Claude-3.5-Sonnet-200k | claude_3_igloo_200k | 200K | 150K | ![ Free] ( https://img.shields.io/badge/free-2feb7a ) |
179- | Claude-3-Opus-200k | claude_3_opus_200k | 200K | 150K | ![ Subscriber] ( https://img.shields.io/badge/subscriber-fc4747 ) |
180- | Claude-3-Sonnet-200k | claude_3_sonnet_200k | 200K | 150K | ![ Subscriber] ( https://img.shields.io/badge/subscriber-fc4747 ) |
181- | Claude-3-Haiku-200k | claude_3_haiku_200k | 200K | 150K | ![ Free] ( https://img.shields.io/badge/free-2feb7a ) |
182- | Claude-2 | claude_2_short | 4K | 3K | ![ Subscriber] ( https://img.shields.io/badge/subscriber-fc4747 ) |
183- | Claude-2-100k | a2_2 | 100K | 75K | ![ Subscriber] ( https://img.shields.io/badge/subscriber-fc4747 ) |
184- | Claude-instant | a2 | 9K | 7K | ![ Free] ( https://img.shields.io/badge/free-2feb7a ) |
185- | Claude-instant-100k | a2_100k | 100K | 75K | ![ Free] ( https://img.shields.io/badge/free-2feb7a ) |
186- | GPT-3.5-Turbo | chinchilla | 4K | 3K | ![ Free] ( https://img.shields.io/badge/free-2feb7a ) |
187- | GPT-3.5-Turbo-Raw | gpt3_5 | 2k | 1.5K | ![ Free] ( https://img.shields.io/badge/free-2feb7a ) |
188- | GPT-3.5-Turbo-Instruct | chinchilla_instruct | 2K | 1.5K | ![ Free] ( https://img.shields.io/badge/free-2feb7a ) |
189- | ChatGPT-16k | agouti | 16K | 12K | ![ Subscriber] ( https://img.shields.io/badge/subscriber-fc4747 ) |
190- | GPT-4-Classic | gpt4_classic | 2K | 1.5K | ![ Subscriber] ( https://img.shields.io/badge/subscriber-fc4747 ) |
191- | GPT-4-Turbo | beaver | 4K | 3K | ![ Subscriber] ( https://img.shields.io/badge/subscriber-fc4747 ) |
192- | GPT-4-Turbo-128k | vizcacha | 128K | 96K | ![ Subscriber] ( https://img.shields.io/badge/subscriber-fc4747 ) |
193- | GPT-4o | gpt4_o | 4k | 3k | ![ Free] ( https://img.shields.io/badge/free-2feb7a ) |
194- | GPT-4o-128k | gpt4_o_128k | 128K | 96K | ![ Subscriber] ( https://img.shields.io/badge/subscriber-fc4747 ) |
195- | Google-PaLM | acouchy | 8K | 6K | ![ Free] ( https://img.shields.io/badge/free-2feb7a ) |
196- | Llama-2-7b | llama_2_7b_chat | 2K | 1.5K | ![ Free] ( https://img.shields.io/badge/free-2feb7a ) |
197- | Llama-2-13b | llama_2_13b_chat | 2K | 1.5K | ![ Free] ( https://img.shields.io/badge/free-2feb7a ) |
198- | Llama-2-70b | llama_2_70b_chat | 2K | 1.5K | ![ Free] ( https://img.shields.io/badge/free-2feb7a ) |
199- | Code-Llama-7b | code_llama_7b_instruct | 4K | 3K | ![ Free] ( https://img.shields.io/badge/free-2feb7a ) |
200- | Code-Llama-13b | code_llama_13b_instruct | 4K | 3K | ![ Free] ( https://img.shields.io/badge/free-2feb7a ) |
201- | Code-Llama-34b | code_llama_34b_instruct | 4K | 3K | ![ Free] ( https://img.shields.io/badge/free-2feb7a ) |
202- | Solar-Mini | upstage_solar_0_70b_16bit | 2K | 1.5K | ![ Free] ( https://img.shields.io/badge/free-2feb7a ) |
171+ | Display Name | Model | Token Limit | Words | Access Type |
172+ | ----------------------- | ------------------------- | ----------- | ----- | --------------------------------------------------------------- |
173+ | Assistant | capybara | 4K | 3K | ![ Free] ( https://img.shields.io/badge/free-2feb7a ) |
174+ | Claude-3.5-Sonnet | claude_3_igloo | 4K | 3K | ![ Free] ( https://img.shields.io/badge/free-2feb7a ) |
175+ | Claude-3-Opus | claude_2_1_cedar | 4K | 3K | ![ Subscriber] ( https://img.shields.io/badge/subscriber-fc4747 ) |
176+ | Claude-3-Sonnet | claude_2_1_bamboo | 4K | 3K | ![ Free] ( https://img.shields.io/badge/free-2feb7a ) |
177+ | Claude-3-Haiku | claude_3_haiku | 4K | 3K | ![ Free] ( https://img.shields.io/badge/free-2feb7a ) |
178+ | Claude-3.5-Sonnet-200k | claude_3_igloo_200k | 200K | 150K | ![ Free] ( https://img.shields.io/badge/free-2feb7a ) |
179+ | Claude-3-Opus-200k | claude_3_opus_200k | 200K | 150K | ![ Subscriber] ( https://img.shields.io/badge/subscriber-fc4747 ) |
180+ | Claude-3-Sonnet-200k | claude_3_sonnet_200k | 200K | 150K | ![ Subscriber] ( https://img.shields.io/badge/subscriber-fc4747 ) |
181+ | Claude-3-Haiku-200k | claude_3_haiku_200k | 200K | 150K | ![ Free] ( https://img.shields.io/badge/free-2feb7a ) |
182+ | Claude-2 | claude_2_short | 4K | 3K | ![ Subscriber] ( https://img.shields.io/badge/subscriber-fc4747 ) |
183+ | Claude-2-100k | a2_2 | 100K | 75K | ![ Subscriber] ( https://img.shields.io/badge/subscriber-fc4747 ) |
184+ | Claude-instant | a2 | 9K | 7K | ![ Free] ( https://img.shields.io/badge/free-2feb7a ) |
185+ | Claude-instant-100k | a2_100k | 100K | 75K | ![ Free] ( https://img.shields.io/badge/free-2feb7a ) |
186+ | GPT-3.5-Turbo | chinchilla | 4K | 3K | ![ Free] ( https://img.shields.io/badge/free-2feb7a ) |
187+ | GPT-3.5-Turbo-Raw | gpt3_5 | 2k | 1.5K | ![ Free] ( https://img.shields.io/badge/free-2feb7a ) |
188+ | GPT-3.5-Turbo-Instruct | chinchilla_instruct | 2K | 1.5K | ![ Free] ( https://img.shields.io/badge/free-2feb7a ) |
189+ | ChatGPT-16k | agouti | 16K | 12K | ![ Subscriber] ( https://img.shields.io/badge/subscriber-fc4747 ) |
190+ | GPT-4-Classic | gpt4_classic | 2K | 1.5K | ![ Subscriber] ( https://img.shields.io/badge/subscriber-fc4747 ) |
191+ | GPT-4-Turbo | beaver | 4K | 3K | ![ Subscriber] ( https://img.shields.io/badge/subscriber-fc4747 ) |
192+ | GPT-4-Turbo-128k | vizcacha | 128K | 96K | ![ Subscriber] ( https://img.shields.io/badge/subscriber-fc4747 ) |
193+ | GPT-4o | gpt4_o | 4k | 3k | ![ Free] ( https://img.shields.io/badge/free-2feb7a ) |
194+ | GPT-4o-128k | gpt4_o_128k | 128K | 96K | ![ Subscriber] ( https://img.shields.io/badge/subscriber-fc4747 ) |
195+ | Google-PaLM | acouchy | 8K | 6K | ![ Free] ( https://img.shields.io/badge/free-2feb7a ) |
196+ | Llama-2-7b | llama_2_7b_chat | 2K | 1.5K | ![ Free] ( https://img.shields.io/badge/free-2feb7a ) |
197+ | Llama-2-13b | llama_2_13b_chat | 2K | 1.5K | ![ Free] ( https://img.shields.io/badge/free-2feb7a ) |
198+ | Llama-2-70b | llama_2_70b_chat | 2K | 1.5K | ![ Free] ( https://img.shields.io/badge/free-2feb7a ) |
199+ | Code-Llama-7b | code_llama_7b_instruct | 4K | 3K | ![ Free] ( https://img.shields.io/badge/free-2feb7a ) |
200+ | Code-Llama-13b | code_llama_13b_instruct | 4K | 3K | ![ Free] ( https://img.shields.io/badge/free-2feb7a ) |
201+ | Code-Llama-34b | code_llama_34b_instruct | 4K | 3K | ![ Free] ( https://img.shields.io/badge/free-2feb7a ) |
202+ | Solar-Mini | upstage_solar_0_70b_16bit | 2K | 1.5K | ![ Free] ( https://img.shields.io/badge/free-2feb7a ) |
203+ | Gemini-1.5-Flash-Search | gemini_pro_search | 4K | 3K | ![ Free] ( https://img.shields.io/badge/free-2feb7a ) |
203204> [ !IMPORTANT]
204205> The data on token limits and word counts listed above are approximate and may not be entirely accurate, as the pre-prompt engineering process of poe.com is private and not publicly disclosed.
205206>
@@ -316,8 +317,36 @@ stream = client.chat.completions.create(
316317)
317318
318319for chunk in stream:
319- if chunk.choices[0 ].delta.content is not None :
320- print (chunk.choices[0 ].delta.content, end = " " )
320+ print (chunk.choices[0 ].delta.content or " " , end = " " , flush = True )
321+
322+ # Set max_tokens
323+ stream_2 = client.chat.completions.create(
324+ model = " claude-instant" ,
325+ messages = [
326+ {" role" : " user" , " content" : " Can you tell me about the creation of blackholes?" }
327+ ],
328+ stream = True ,
329+ max_tokens = 20 , # if max_tokens reached, finish_reason will be 'length'
330+ )
331+
332+ for chunk in stream_2:
333+ print (chunk.choices[0 ].delta.content or " " , end = " " , flush = True )
334+
335+ # Include usage
336+ stream_3 = client.chat.completions.create(
337+ model = " claude-instant" ,
338+ messages = [
339+ {" role" : " user" , " content" : " Write a 100-character meta description for my blog post about llamas" }
340+ ],
341+ stream = True ,
342+ max_tokens = 4096 ,
343+ stream_options = {
344+ " include_usage" : True # last chunk contains prompts_tokens, completion_tokens and total_tokens
345+ }
346+ )
347+
348+ for chunk in stream_3:
349+ print (chunk, end = " \n\n " , flush = True )
321350```
322351- Image input example:
323352``` py
@@ -433,9 +462,10 @@ import openai
433462client = openai.OpenAI(api_key = " anything" , base_url = " http://127.0.0.1:8000/v1/" , default_headers = {" Authorization" : " Bearer anything" })
434463
435464images_url = client.images.generate(
436- model = " sdxl " ,
465+ model = " playground-v2.5 " ,
437466 prompt = " A cute baby sea otter" ,
438467 n = 2 , # The number of images to generate
468+ size = " 1792x1024" # The size of image (view models.json for available sizes)
439469)
440470
441471print (images_url)
@@ -447,9 +477,10 @@ client = openai.OpenAI(api_key="anything", base_url="http://127.0.0.1:8000/v1/",
447477
448478images_url = client.images.edit(
449479 image = " https://imgcdn.stablediffusionweb.com/2024/4/29/0b0b8798-1965-4e3d-b0a8-d153728320d4.jpg" ,
450- model = " playground-v2.5 " ,
480+ model = " sdxl " ,
451481 prompt = " A cute baby sea otter wearing a raincoat" ,
452482 n = 1 , # The number of images to generate
483+ size = " 1024x1024" # The size of image (view models.json for available sizes)
453484)
454485
455486print (images_url)
0 commit comments