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 GPT-4o and GPT-4o-mini models in both the OpenAI and the Azure OpenAI version #17

Merged
merged 1 commit into from
Oct 1, 2024
Merged
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
69 changes: 64 additions & 5 deletions prompterator/models/openai_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,14 +121,62 @@ def format_prompt(self, system_prompt, user_prompt, **kwargs):
return messages


class GPT4o(ChatGPTMixin):
name = "gpt-4o"
properties = ModelProperties(
name="gpt-4o",
is_chat_model=True,
handles_batches_of_inputs=False,
configurable_params=CONFIGURABLE_MODEL_PARAMETER_PROPERTIES.copy(),
position_index=1,
)


class GPT4oAzure(ChatGPTMixin):
name = "gpt-4o (Azure)"
properties = ModelProperties(
name="gpt-4o (Azure)",
is_chat_model=True,
handles_batches_of_inputs=False,
configurable_params=CONFIGURABLE_MODEL_PARAMETER_PROPERTIES.copy(),
position_index=6,
)
openai_variant = "azure"
specific_model_name = "gpt-4o"


class GPT4oMini(ChatGPTMixin):
name = "gpt-4o-mini"
properties = ModelProperties(
name="gpt-4o-mini",
is_chat_model=True,
handles_batches_of_inputs=False,
configurable_params=CONFIGURABLE_MODEL_PARAMETER_PROPERTIES.copy(),
position_index=2,
)


class GPT4oMiniAzure(ChatGPTMixin):
name = "gpt-4o-mini (Azure)"
properties = ModelProperties(
name="gpt-4o-mini (Azure)",
is_chat_model=True,
handles_batches_of_inputs=False,
configurable_params=CONFIGURABLE_MODEL_PARAMETER_PROPERTIES.copy(),
position_index=7,
)
openai_variant = "azure"
specific_model_name = "gpt-4o-mini"


class GPT35Turbo(ChatGPTMixin):
name = "gpt-3.5-turbo"
properties = ModelProperties(
name="gpt-3.5-turbo",
is_chat_model=True,
handles_batches_of_inputs=False,
configurable_params=CONFIGURABLE_MODEL_PARAMETER_PROPERTIES.copy(),
position_index=1,
position_index=3,
)


Expand All @@ -139,7 +187,7 @@ class GPT35TurboAzure(ChatGPTMixin):
is_chat_model=True,
handles_batches_of_inputs=False,
configurable_params=CONFIGURABLE_MODEL_PARAMETER_PROPERTIES.copy(),
position_index=3,
position_index=8,
)
openai_variant = "azure"
specific_model_name = "gpt-35-turbo"
Expand All @@ -152,7 +200,7 @@ class GPT4(ChatGPTMixin):
is_chat_model=True,
handles_batches_of_inputs=False,
configurable_params=CONFIGURABLE_MODEL_PARAMETER_PROPERTIES.copy(),
position_index=2,
position_index=4,
)


Expand All @@ -163,7 +211,7 @@ class GPT4Azure(ChatGPTMixin):
is_chat_model=True,
handles_batches_of_inputs=False,
configurable_params=CONFIGURABLE_MODEL_PARAMETER_PROPERTIES.copy(),
position_index=4,
position_index=9,
)
openai_variant = "azure"
specific_model_name = "gpt-4"
Expand Down Expand Up @@ -232,4 +280,15 @@ def call(self, idx, input, **kwargs):
return {"response": response_text, "data": response_data, "idx": idx}


__all__ = ["GPT35Turbo", "GPT4", "GPT35TurboAzure", "GPT4Azure", "GPT4Vision", "MockGPT35Turbo"]
__all__ = [
"GPT4o",
"GPT4oAzure",
"GPT4oMini",
"GPT4oMiniAzure",
"GPT35Turbo",
"GPT4",
"GPT35TurboAzure",
"GPT4Azure",
"GPT4Vision",
"MockGPT35Turbo",
]
Loading