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 for changing system message role - this allows using o1-preview and o1-mini models #3591

Open
wants to merge 2 commits into
base: 0.2
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion autogen/agentchat/conversable_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ def __init__(
description: Optional[str] = None,
chat_messages: Optional[Dict[Agent, List[Dict]]] = None,
silent: Optional[bool] = None,
role_for_system_message: Literal["system", "user"] = "system",
):
"""
Args:
Expand Down Expand Up @@ -143,7 +144,7 @@ def __init__(
else:
self._oai_messages = chat_messages

self._oai_system_message = [{"content": system_message, "role": "system"}]
self._oai_system_message = [{"content": system_message, "role": role_for_system_message}]
self._description = description if description is not None else system_message
self._is_termination_msg = (
is_termination_msg
Expand Down
6 changes: 6 additions & 0 deletions autogen/oai/openai_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@
DEFAULT_AZURE_API_VERSION = "2024-02-01"
OAI_PRICE1K = {
# https://openai.com/api/pricing/
# o1-preview
"o1-preview": (0.015, 0.060),
"o1-preview-2024-09-12": (0.015, 0.060),
# o1-mini
"o1-mini": (0.003, 0.012),
"o1-mini-2024-09-12": (0.003, 0.012),
# gpt-4o
"gpt-4o": (0.005, 0.015),
"gpt-4o-2024-05-13": (0.005, 0.015),
Expand Down
Loading