mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-19 05:09:38 +02:00
feat(assistant): improve chat functionality and update tests - refactor configurable model, update OpenAI provider, enhance chat form UI, and improve test coverage (#2316)
Updated model to GPT 4.1
This commit is contained in:
parent
e7f1506728
commit
4f5068e7e5
15 changed files with 41 additions and 44 deletions
|
@ -30,8 +30,7 @@ module Assistant::Configurable
|
|||
|
||||
## Your purpose
|
||||
|
||||
You help users understand their financial data by answering questions about their accounts,
|
||||
transactions, income, expenses, net worth, and more.
|
||||
You help users understand their financial data by answering questions about their accounts, transactions, income, expenses, net worth, forecasting and more.
|
||||
|
||||
## Your rules
|
||||
|
||||
|
@ -66,11 +65,9 @@ module Assistant::Configurable
|
|||
|
||||
### Rules about financial advice
|
||||
|
||||
You are NOT a licensed financial advisor and therefore, you should not provide any specific investment advice (such as "buy this stock", "sell that bond", "invest in crypto", etc.).
|
||||
You should focus on educating the user about personal finance using their own data so they can make informed decisions.
|
||||
|
||||
Instead, you should focus on educating the user about personal finance using their own data so they can make informed decisions.
|
||||
|
||||
- Do not suggest investments or financial products
|
||||
- Do not tell the user to buy or sell specific financial products or investments.
|
||||
- Do not make assumptions about the user's financial situation. Use the functions available to get the data you need.
|
||||
|
||||
### Function calling rules
|
||||
|
|
|
@ -4,7 +4,7 @@ class Provider::Openai < Provider
|
|||
# Subclass so errors caught in this provider are raised as Provider::Openai::Error
|
||||
Error = Class.new(Provider::Error)
|
||||
|
||||
MODELS = %w[gpt-4o]
|
||||
MODELS = %w[gpt-4.1]
|
||||
|
||||
def initialize(access_token)
|
||||
@client = ::OpenAI::Client.new(access_token: access_token)
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
data: { chat_target: "form" } do |f| %>
|
||||
|
||||
<%# In the future, this will be a dropdown with different AI models %>
|
||||
<%= f.hidden_field :ai_model, value: "gpt-4o" %>
|
||||
<%= f.hidden_field :ai_model, value: "gpt-4.1" %>
|
||||
|
||||
<%= f.text_area :content, placeholder: "Ask anything ...", value: message_hint,
|
||||
class: "w-full border-0 focus:ring-0 text-sm resize-none px-1 bg-transparent",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue