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

OpenAI o1 model support #43

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

OpenAI o1 model support #43

wants to merge 7 commits into from

Conversation

marklysze
Copy link
Collaborator

@marklysze marklysze commented Sep 13, 2024

Why are these changes needed?

OpenAI has just released o1-mini and o1-preview, these changes add support for the model.

I don't have level 5 API access to test against the API, if anyone can test with the models that would be great.

Notes:

  • OpenAI is depreciating max_tokens and max_completion_tokens should be used. Code maps max_tokens to max_completion_tokens.
  • Beta limitations

Tests still TODO.

Related issue number

Checks

Copy link
Collaborator

@BabyCNM BabyCNM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I cannot test o1 yet because of limited access. However, the implementation looks great.

A lint question: should we rename "map_params" to "_map_params" for readability?

Copy link
Collaborator

@BabyCNM BabyCNM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 'num_tokens' change and test updates are good to have.

autogen/token_count_utils.py Show resolved Hide resolved
autogen/oai/client.py Show resolved Hide resolved
test/agentchat/test_function_call.py Outdated Show resolved Hide resolved
autogen/token_count_utils.py Outdated Show resolved Hide resolved
autogen/oai/client.py Show resolved Hide resolved
@sonichi
Copy link
Collaborator

sonichi commented Sep 29, 2024

@marklysze could you check the build error? It indicates some problem with the token counting.

@yiranwu0
Copy link
Collaborator

yiranwu0 commented Oct 1, 2024

@marklysze could you check the build error? It indicates some problem with the token counting.

This should be related to the change in count_token function.

@marklysze
Copy link
Collaborator Author

marklysze commented Oct 2, 2024

@marklysze could you check the build error? It indicates some problem with the token counting.

This should be related to the change in count_token function.

All good, committing correction shortly

Update: committed

@sonichi
Copy link
Collaborator

sonichi commented Oct 3, 2024

@qingyun-wu could you make sure there's an o1 endpoint in the config list used by the openai CI?
@BabyCNM has your change request been addressed?

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.

4 participants