Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support of o1-preview, o1-mini, and fix claude-3.5-sonnet for the proxy server #210

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

grapeot
Copy link

@grapeot grapeot commented Nov 26, 2024

It seems POE changed how a bot is identified, which broke the usage of Claude 3.5 Sonnet in the proxy server. This PR fixes the issue by using the updated bot name and also added support for o1-preview and o1-mini.

How the code was tested:

  1. pip install -e .
  2. Server side:
from poe_api_wrapper import PoeServer
tokens = [
    {"p-b": p_b, "p-lat": p_lat},
]
PoeServer(tokens=tokens)
PoeServer(tokens=tokens, address="0.0.0.0", port="8080")
  1. Client side:
import openai 
client = openai.OpenAI(api_key="anything", base_url="http://127.0.0.1:8080/v1/", default_headers={"Authorization": "Bearer anything"})

# Non-Streaming Example
response = client.chat.completions.create(
    model="o1-mini", 
    messages = [
                {"role": "user", "content": "Hi!"}
            ]
)

print(response.choices[0].message.content)

The test was performed on all four models.

@grapeot
Copy link
Author

grapeot commented Nov 26, 2024

Should be able to fix #182

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant