mirror of
https://github.com/guohuadeng/app-odoo.git
synced 2025-02-23 04:11:36 +02:00
add gpt
This commit is contained in:
19
app_chatgpt/models/ai_robot.py
Normal file
19
app_chatgpt/models/ai_robot.py
Normal file
@@ -0,0 +1,19 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import requests
|
||||
from odoo import api, fields, models, _
|
||||
|
||||
|
||||
class AiRobot(models.Model):
|
||||
_name = 'ai.robot'
|
||||
_description = 'Gpt Robot'
|
||||
_order = 'sequence, name'
|
||||
|
||||
name = fields.Char(string='Name', translate=True)
|
||||
openapi_api_key = fields.Char(string="API Key", help="Provide the API key here")
|
||||
temperature = fields.Float(string='Temperature', default=0.9)
|
||||
sequence = fields.Integer('Sequence', help="Determine the display order", default=10)
|
||||
|
||||
def action_disconnect(self):
|
||||
requests.delete('https://chatgpt.com/v1/disconnect')
|
||||
|
||||
Reference in New Issue
Block a user