Skip to content

Commit

Permalink
feature: added o1 models
Browse files Browse the repository at this point in the history
  • Loading branch information
DevEmperor committed Nov 4, 2024
1 parent df4b163 commit 89284fc
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public View getView (int position, View convertView, @NonNull ViewGroup parent)
modelNameTv.setText(WristAssistUtil.translate(context, dataProvider.getModelName()));

TextView tokensTv = listItem.findViewById(R.id.item_usage_tokens_tv);
if (dataProvider.getModelName().startsWith("gpt")) {
if (dataProvider.getModelName().startsWith("gpt") || dataProvider.getModelName().startsWith("o1")) {
tokensTv.setText(context.getString(R.string.wristassist_token_usage,
String.format(Locale.getDefault(), "%,d", dataProvider.getTokens())));
} else if (dataProvider.getModelName().startsWith("dall-e")) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,14 @@ public static double calcCostChat(String model, long promptTokens, long completi
inputPrice = 0.03;
outputPrice = 0.06;
break;
case "o1-preview":
inputPrice = 0.015;
outputPrice = 0.06;
break;
case "o1-mini":
inputPrice = 0.003;
outputPrice = 0.012;
break;
case "gpt-3.5-turbo":
inputPrice = 0.0005;
outputPrice = 0.0015;
Expand Down
4 changes: 4 additions & 0 deletions app/src/main/res/values/arrays.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,17 @@
<item name="gpt-4o">GPT-4 Omni</item>
<item name="gpt-4-turbo">GPT-4 Turbo</item>
<item name="gpt-4">GPT-4</item>
<item name="o1-preview">o1-preview</item>
<item name="o1-mini">o1-mini</item>
<item name="gpt-3.5-turbo">GPT-3.5 Turbo</item>
</string-array>
<string-array name="models_chat_values">
<item name="gpt-4o-mini">gpt-4o-mini</item>
<item name="gpt-4o">gpt-4o</item>
<item name="gpt-4-turbo">gpt-4-turbo</item>
<item name="gpt-4">gpt-4</item>
<item name="o1-preview">o1-preview</item>
<item name="o1-mini">o1-mini</item>
<item name="gpt-3.5-turbo">gpt-3.5-turbo</item>
</string-array>

Expand Down

0 comments on commit 89284fc

Please sign in to comment.