mirror of
https://github.com/we-promise/sure.git
synced 2026-04-19 12:04:08 +00:00
Add Langfuse-based LLM observability (#86)
* Add Langfuse-based LLM observability * Document Langfuse configuration * Don't hardcode model in use
This commit is contained in:
@@ -1,13 +1,14 @@
|
||||
class Provider::Openai::AutoCategorizer
|
||||
def initialize(client, transactions: [], user_categories: [])
|
||||
def initialize(client, model: "", transactions: [], user_categories: [])
|
||||
@client = client
|
||||
@model = model
|
||||
@transactions = transactions
|
||||
@user_categories = user_categories
|
||||
end
|
||||
|
||||
def auto_categorize
|
||||
response = client.responses.create(parameters: {
|
||||
model: "gpt-4.1-mini",
|
||||
model: model,
|
||||
input: [ { role: "developer", content: developer_message } ],
|
||||
text: {
|
||||
format: {
|
||||
@@ -26,7 +27,7 @@ class Provider::Openai::AutoCategorizer
|
||||
end
|
||||
|
||||
private
|
||||
attr_reader :client, :transactions, :user_categories
|
||||
attr_reader :client, :model, :transactions, :user_categories
|
||||
|
||||
AutoCategorization = Provider::LlmConcept::AutoCategorization
|
||||
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
class Provider::Openai::AutoMerchantDetector
|
||||
def initialize(client, transactions:, user_merchants:)
|
||||
def initialize(client, model: "", transactions:, user_merchants:)
|
||||
@client = client
|
||||
@model = model
|
||||
@transactions = transactions
|
||||
@user_merchants = user_merchants
|
||||
end
|
||||
|
||||
def auto_detect_merchants
|
||||
response = client.responses.create(parameters: {
|
||||
model: "gpt-4.1-mini",
|
||||
model: model,
|
||||
input: [ { role: "developer", content: developer_message } ],
|
||||
text: {
|
||||
format: {
|
||||
@@ -26,7 +27,7 @@ class Provider::Openai::AutoMerchantDetector
|
||||
end
|
||||
|
||||
private
|
||||
attr_reader :client, :transactions, :user_merchants
|
||||
attr_reader :client, :model, :transactions, :user_merchants
|
||||
|
||||
AutoDetectedMerchant = Provider::LlmConcept::AutoDetectedMerchant
|
||||
|
||||
|
||||
Reference in New Issue
Block a user