mirror of
https://github.com/guohuadeng/app-odoo.git
synced 2025-02-23 04:11:36 +02:00
fix #I6YSMC [app_chatgpt] 用户Ai对话用量增加最近提问
This commit is contained in:
@@ -170,7 +170,8 @@ GPT-3 A set of models that can understand and generate natural language
|
||||
'ai_completion_tokens': completion_tokens,
|
||||
'tokens_total': total_tokens,
|
||||
'used_number': 1,
|
||||
'first_ask_time': ask_date
|
||||
'first_ask_time': ask_date,
|
||||
'latest_ask_time': ask_date
|
||||
})
|
||||
else:
|
||||
vals = {
|
||||
@@ -178,6 +179,7 @@ GPT-3 A set of models that can understand and generate natural language
|
||||
'ai_completion_tokens': ai_use.ai_completion_tokens + completion_tokens,
|
||||
'tokens_total': ai_use.tokens_total + total_tokens,
|
||||
'used_number': ai_use.used_number + 1,
|
||||
'latest_ask_time': ask_date
|
||||
}
|
||||
if not ai_use.first_ask_time:
|
||||
vals.update({
|
||||
|
||||
@@ -10,6 +10,7 @@ class ResPartnerAiUse(models.Model):
|
||||
name = fields.Many2one('res.partner', 'Partner')
|
||||
ai_user_id = fields.Many2one('res.users', 'Ai User', domain=[('gpt_id', '!=', False)])
|
||||
first_ask_time = fields.Datetime('First Ask Time')
|
||||
latest_ask_time = fields.Datetime('Latest Ask Time')
|
||||
service_start_date = fields.Datetime('Service Start Date')
|
||||
service_end_date = fields.Datetime('Service End Date')
|
||||
used_number = fields.Integer('Number of Used')
|
||||
|
||||
Reference in New Issue
Block a user