mirror of
https://github.com/discourse/discourse-ai.git
synced 2025-02-16 16:34:45 +00:00
A new feature_context json column was added to ai_api_audit_logs This allows us to store rich json like context on any LLM request made. This new field now stores automation id and name. Additionally allows llm_triage to specify maximum number of tokens This means that you can limit the cost of llm triage by scanning only first N tokens of a post.
37 lines
895 B
Ruby
37 lines
895 B
Ruby
# frozen_string_literal: true
|
|
|
|
class AiApiAuditLog < ActiveRecord::Base
|
|
belongs_to :post
|
|
belongs_to :topic
|
|
|
|
module Provider
|
|
OpenAI = 1
|
|
Anthropic = 2
|
|
HuggingFaceTextGeneration = 3
|
|
Gemini = 4
|
|
Vllm = 5
|
|
Cohere = 6
|
|
Ollama = 7
|
|
SambaNova = 8
|
|
end
|
|
end
|
|
|
|
# == Schema Information
|
|
#
|
|
# Table name: ai_api_audit_logs
|
|
#
|
|
# id :bigint not null, primary key
|
|
# provider_id :integer not null
|
|
# user_id :integer
|
|
# request_tokens :integer
|
|
# response_tokens :integer
|
|
# raw_request_payload :string
|
|
# raw_response_payload :string
|
|
# created_at :datetime not null
|
|
# updated_at :datetime not null
|
|
# topic_id :integer
|
|
# post_id :integer
|
|
# feature_name :string(255)
|
|
# language_model :string(255)
|
|
# feature_context :jsonb
|