update misc

This commit is contained in:
Ivan Office
2023-09-13 00:31:48 +08:00
parent 46ef67bb08
commit 06d2d50089
2 changed files with 3 additions and 4 deletions

View File

@@ -17,11 +17,11 @@ class AiRobot(models.Model):
provider = fields.Selection( provider = fields.Selection(
selection_add=[('google', 'Google Ai')], selection_add=[('google', 'Google Ai')],
ondelete={'google': 'cascade'} ondelete={'google': 'set default'}
), ),
set_ai_model = fields.Selection( set_ai_model = fields.Selection(
selection_add=[('google-bard', 'Google Bard')], selection_add=[('google-bard', 'Google Bard')],
ondelete={'google-bard': 'cascade'}) ondelete={'google-bard': 'set default'})
@api.onchange('provider') @api.onchange('provider')
def _onchange_provider(self): def _onchange_provider(self):

View File

@@ -22,8 +22,7 @@ class AiRobot(models.Model):
provider = fields.Selection(string="AI Provider", selection=[('openai', 'OpenAI'), ('azure', 'Azure')], provider = fields.Selection(string="AI Provider", selection=[('openai', 'OpenAI'), ('azure', 'Azure')],
required=True, default='openai', change_default=True) required=True, default='openai', change_default=True)
# update ai_robot set ai_model=set_ai_model # update ai_robot set ai_model=set_ai_model
ai_model = fields.Char(string="AI Model", required=True, default='auto', help='Customize input', ondelete=None) ai_model = fields.Char(string="AI Model", required=True, default='auto', help='Customize input')
set_ai_model = fields.Selection(string="Quick Set Model", selection=[ set_ai_model = fields.Selection(string="Quick Set Model", selection=[
('gpt-3.5-turbo-0613', 'gpt-3.5-turbo-0613(Default and Latest)'), ('gpt-3.5-turbo-0613', 'gpt-3.5-turbo-0613(Default and Latest)'),
('gpt-3.5-turbo-16k-0613', 'gpt-3.5-turbo-16k-0613(Big text)'), ('gpt-3.5-turbo-16k-0613', 'gpt-3.5-turbo-16k-0613(Big text)'),