Skip to content

Commit 022d81b

Browse files
committed
Display default LLM model used before prompt instructions
1 parent de8d78a commit 022d81b

File tree

4 files changed

+11
-4
lines changed

4 files changed

+11
-4
lines changed

app/models/provider/openai.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def supports_model?(model)
1414
MODELS.include?(model)
1515
end
1616

17-
def auto_categorize(transactions: [], user_categories: [], model: "gpt-4.1-mini")
17+
def auto_categorize(transactions: [], user_categories: [], model: "")
1818
with_provider_response do
1919
raise Error, "Too many transactions to auto-categorize. Max is 25 per request." if transactions.size > 25
2020

@@ -36,7 +36,7 @@ def auto_categorize(transactions: [], user_categories: [], model: "gpt-4.1-mini"
3636
end
3737
end
3838

39-
def auto_detect_merchants(transactions: [], user_merchants: [], model: "gpt-4.1-mini")
39+
def auto_detect_merchants(transactions: [], user_merchants: [], model: "")
4040
with_provider_response do
4141
raise Error, "Too many transactions to auto-detect merchants. Max is 25 per request." if transactions.size > 25
4242

app/models/provider/openai/auto_categorizer.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
class Provider::Openai::AutoCategorizer
2+
DEFAULT_MODEL = "gpt-4.1-mini"
3+
24
def initialize(client, model: "", transactions: [], user_categories: [])
35
@client = client
46
@model = model
@@ -8,7 +10,7 @@ def initialize(client, model: "", transactions: [], user_categories: [])
810

911
def auto_categorize
1012
response = client.responses.create(parameters: {
11-
model: model,
13+
model: model.presence || DEFAULT_MODEL,
1214
input: [ { role: "developer", content: developer_message } ],
1315
text: {
1416
format: {

app/models/provider/openai/auto_merchant_detector.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
class Provider::Openai::AutoMerchantDetector
2+
DEFAULT_MODEL = "gpt-4.1-mini"
3+
24
def initialize(client, model: "", transactions:, user_merchants:)
35
@client = client
46
@model = model
@@ -8,7 +10,7 @@ def initialize(client, model: "", transactions:, user_merchants:)
810

911
def auto_detect_merchants
1012
response = client.responses.create(parameters: {
11-
model: model,
13+
model: model.presence || DEFAULT_MODEL,
1214
input: [ { role: "developer", content: developer_message } ],
1315
text: {
1416
format: {

app/views/settings/ai_prompts/show.html.erb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
<span class="text-xs font-medium text-primary uppercase"><%= t(".prompt_instructions") %></span>
2727
<%= icon "chevron-right", class: "group-open:transform group-open:rotate-90" %>
2828
</summary>
29+
<pre class="whitespace-pre-wrap text-xs font-mono text-primary">[<%= Provider::Openai::MODELS.join(", ") %>]</pre>
2930
<div class="mt-2 px-3 py-2 bg-surface-default border border-primary rounded-lg">
3031
<pre class="whitespace-pre-wrap text-xs font-mono text-primary"><%= @assistant_config[:instructions] %></pre>
3132
</div>
@@ -53,6 +54,7 @@
5354
<span class="text-xs font-medium text-primary uppercase"><%= t(".prompt_instructions") %></span>
5455
<%= icon "chevron-right", class: "group-open:transform group-open:rotate-90" %>
5556
</summary>
57+
<pre class="whitespace-pre-wrap text-xs font-mono text-primary">[<%= Provider::Openai::AutoCategorizer::DEFAULT_MODEL %>]</pre>
5658
<div class="mt-2 px-3 py-2 bg-surface-default border border-primary rounded-lg">
5759
<pre class="whitespace-pre-wrap text-xs font-mono text-primary"><%= @assistant_config[:auto_categorizer]&.instructions || Provider::Openai::AutoCategorizer.new(nil).instructions %></pre>
5860
</div>
@@ -80,6 +82,7 @@
8082
<span class="text-xs font-medium text-primary uppercase"><%= t(".prompt_instructions") %></span>
8183
<%= icon "chevron-right", class: "group-open:transform group-open:rotate-90" %>
8284
</summary>
85+
<pre class="whitespace-pre-wrap text-xs font-mono text-primary">[<%= Provider::Openai::AutoMerchantDetector::DEFAULT_MODEL %>]</pre>
8386
<div class="mt-2 px-3 py-2 bg-surface-default border border-primary rounded-lg">
8487
<pre class="whitespace-pre-wrap text-xs font-mono text-primary"><%= @assistant_config[:auto_merchant]&.instructions || Provider::Openai::AutoMerchantDetector.new(nil, model: "", transactions: [], user_merchants: []).instructions %></pre>
8588
</div>

0 commit comments

Comments
 (0)