FEATURE: support topic_id and post_id logging in ai audit log (#274)
This makes it easier to track who is responsible for a completion in logs Note: ai helper and summarization are not yet implemented
This commit is contained in:
@@ -14,6 +14,7 @@ module ::DiscourseAi
|
||||
max_tokens: nil,
|
||||
user_id: nil,
|
||||
stop_sequences: nil,
|
||||
post: nil,
|
||||
&blk
|
||||
)
|
||||
# HACK to get around the fact that they have different APIs
|
||||
@@ -78,6 +79,8 @@ module ::DiscourseAi
|
||||
provider_id: AiApiAuditLog::Provider::Anthropic,
|
||||
raw_request_payload: request_body,
|
||||
user_id: user_id,
|
||||
post_id: post&.id,
|
||||
topic_id: post&.topic_id,
|
||||
)
|
||||
|
||||
if !block_given?
|
||||
|
||||
@@ -20,6 +20,7 @@ module ::DiscourseAi
|
||||
user_id: nil,
|
||||
retries: DEFAULT_RETRIES,
|
||||
retry_timeout: DEFAULT_RETRY_TIMEOUT_SECONDS,
|
||||
post: nil,
|
||||
&blk
|
||||
)
|
||||
log = nil
|
||||
@@ -103,6 +104,8 @@ module ::DiscourseAi
|
||||
provider_id: AiApiAuditLog::Provider::OpenAI,
|
||||
raw_request_payload: request_body,
|
||||
user_id: user_id,
|
||||
post_id: post&.id,
|
||||
topic_id: post&.topic_id,
|
||||
)
|
||||
|
||||
if !blk
|
||||
|
||||
Reference in New Issue
Block a user