Skip to content

Commit

Permalink
o1 models (#17307)
Browse files Browse the repository at this point in the history
* add latest o1 model support

* multimodal too
  • Loading branch information
logan-markewich authored Dec 18, 2024
1 parent 6d770ae commit 55f4aa5
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
DEFAULT_OPENAI_API_VERSION = ""

O1_MODELS: Dict[str, int] = {
"o1": 200000,
"o1-2024-12-17": 200000,
"o1-preview": 128000,
"o1-preview-2024-09-12": 128000,
"o1-mini": 128000,
Expand Down Expand Up @@ -304,7 +306,7 @@ def to_openai_message_dict(
# TODO: O1 models do not support system prompts
if model is not None and model in O1_MODELS:
if message_dict["role"] == "system":
message_dict["role"] = "user"
message_dict["role"] = "developer"

# NOTE: openai messages have additional arguments:
# - function messages have `name`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ exclude = ["**/BUILD"]
license = "MIT"
name = "llama-index-llms-openai"
readme = "README.md"
version = "0.3.10"
version = "0.3.11"

[tool.poetry.dependencies]
python = ">=3.9,<4.0"
openai = "^1.57.1"
openai = "^1.58.1"
llama-index-core = "^0.12.4"

[tool.poetry.group.dev.dependencies]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
"gpt-4o-2024-08-06": 128000,
"gpt-4o-mini": 128000,
"gpt-4o-mini-2024-07-18": 128000,
"o1": 200000,
"o1-2024-12-17": 200000,
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ exclude = ["**/BUILD"]
license = "MIT"
name = "llama-index-multi-modal-llms-openai"
readme = "README.md"
version = "0.4.0"
version = "0.4.1"

[tool.poetry.dependencies]
python = ">=3.9,<4.0"
Expand Down

0 comments on commit 55f4aa5

Please sign in to comment.