Skip to content

poe-platform/poe-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

poe

Official Python client for the Poe chat completions API.

Installation

pip install poe

Quick Start

from poe import PoeClient

client = PoeClient(api_key="your-poe-api-key")

# Simple chat
response = client.chat("What is Python?", model="GPT-4o")
print(response["choices"][0]["message"]["content"])

Streaming

for chunk in client.stream("Tell me a story", model="GPT-4o"):
    print(chunk, end="", flush=True)

Options

client = PoeClient(
    api_key="your-key",
    timeout=120.0,       # request timeout in seconds
)

response = client.chat(
    "Explain quantum computing",
    model="GPT-4o",
    temperature=0.7,
    max_tokens=1024,
    system_prompt="You are a helpful physics teacher.",
)

Context Manager

with PoeClient(api_key="your-key") as client:
    resp = client.chat("Hello!")
    print(resp["choices"][0]["message"]["content"])

API Key

Get your API key from poe.com/api_key.

License

MIT

About

Python package for Poe

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Languages