Skip to content
This repository was archived by the owner on Aug 31, 2025. It is now read-only.

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

Open
grapeot wants to merge 1 commit into
snowby666:mainfrom
grapeot:main
Open

Add support of o1-preview, o1-mini, and fix claude-3.5-sonnet for the proxy server#210
grapeot wants to merge 1 commit into
snowby666:mainfrom
grapeot:main

Conversation

@grapeot

@grapeot grapeot commented Nov 26, 2024

Copy link
Copy Markdown

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

grapeot commented Nov 26, 2024

Copy link
Copy Markdown
Author

Should be able to fix #182

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant