Skip to content

Commit ea04280

Browse files
openai developer message fix (#17833)
1 parent 58caf3f commit ea04280

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

llama-index-integrations/llms/llama-index-llms-openai/llama_index/llms/openai/utils.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,11 @@ def to_openai_message_dict(
354354
}
355355

356356
# TODO: O1 models do not support system prompts
357-
if model is not None and model in O1_MODELS:
357+
if (
358+
model is not None
359+
and model in O1_MODELS
360+
and model not in O1_MODELS_WITHOUT_FUNCTION_CALLING
361+
):
358362
if message_dict["role"] == "system":
359363
message_dict["role"] = "developer"
360364

llama-index-integrations/llms/llama-index-llms-openai/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ exclude = ["**/BUILD"]
2929
license = "MIT"
3030
name = "llama-index-llms-openai"
3131
readme = "README.md"
32-
version = "0.3.19"
32+
version = "0.3.20"
3333

3434
[tool.poetry.dependencies]
3535
python = ">=3.9,<4.0"

0 commit comments

Comments
 (0)