2023-04-26 11:44:29 +10:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class AiApiAuditLog < ActiveRecord::Base
|
2024-04-15 23:22:06 +10:00
|
|
|
belongs_to :post
|
|
|
|
belongs_to :topic
|
|
|
|
|
2023-04-26 11:44:29 +10:00
|
|
|
module Provider
|
|
|
|
OpenAI = 1
|
2023-05-11 10:03:03 -03:00
|
|
|
Anthropic = 2
|
2023-07-27 13:55:32 -03:00
|
|
|
HuggingFaceTextGeneration = 3
|
2023-12-15 14:32:01 -03:00
|
|
|
Gemini = 4
|
2023-12-26 14:49:55 -03:00
|
|
|
Vllm = 5
|
2024-04-11 07:24:17 +10:00
|
|
|
Cohere = 6
|
2024-05-07 10:02:16 -03:00
|
|
|
Ollama = 7
|
2024-09-12 11:28:08 +10:00
|
|
|
SambaNova = 8
|
2023-04-26 11:44:29 +10:00
|
|
|
end
|
|
|
|
end
|
2023-05-11 10:03:03 -03:00
|
|
|
|
|
|
|
# == 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
|
2024-05-14 13:28:46 +10:00
|
|
|
# topic_id :integer
|
|
|
|
# post_id :integer
|
|
|
|
# feature_name :string(255)
|
2024-05-27 16:46:01 +10:00
|
|
|
# language_model :string(255)
|
2023-05-11 10:03:03 -03:00
|
|
|
#
|