Files
app-odoo/app_chatgpt/models/ai_robot.py
ivan deng c64e65db2d add gpt
2023-03-02 18:51:05 +08:00

20 lines
588 B
Python

# -*- 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')