Skip to content

Commit

Permalink
Add GPT-4o and GPT-4o-mini models in both the OpenAI and the Azure Op…
Browse files Browse the repository at this point in the history
…enAI version
  • Loading branch information
samsucik committed Oct 1, 2024
1 parent 7df928d commit 201f188
Showing 1 changed file with 64 additions and 5 deletions.
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",
]

0 comments on commit 201f188

Please sign in to comment.