5.6対応
This commit is contained in:
+55
-24
@@ -9,35 +9,64 @@
|
|||||||
;; configuration
|
;; configuration
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
||||||
(defvar lab-ai-url
|
(defgroup lab-ai nil
|
||||||
"https://amorphous.tf.chiba-u.jp/lab-ai/chat")
|
"Lab-AI client."
|
||||||
|
:group 'applications)
|
||||||
|
|
||||||
(defvar lab-ai-image-url
|
(defconst lab-ai-url
|
||||||
"https://amorphous.tf.chiba-u.jp/lab-ai/image")
|
"https://amorphous.tf.chiba-u.jp/lab-ai/chat"
|
||||||
|
"Lab-AI chat endpoint.")
|
||||||
|
|
||||||
(defvar lab-ai-image-edit-url
|
(defconst lab-ai-image-url
|
||||||
"https://amorphous.tf.chiba-u.jp/lab-ai/image-edit")
|
"https://amorphous.tf.chiba-u.jp/lab-ai/image"
|
||||||
|
"Lab-AI image generation endpoint.")
|
||||||
|
|
||||||
(defvar lab-ai-image-size
|
(defconst lab-ai-image-edit-url
|
||||||
"1024x1024")
|
"https://amorphous.tf.chiba-u.jp/lab-ai/image-edit"
|
||||||
|
"Lab-AI image editing endpoint.")
|
||||||
|
|
||||||
|
(defconst lab-ai-supported-models
|
||||||
|
'("gpt-5.6-luna"
|
||||||
|
"gpt-5.6-terra"
|
||||||
|
"gpt-5.6-sol")
|
||||||
|
"Models supported by the Lab-AI gateway.")
|
||||||
|
|
||||||
(defvar lab-ai-models
|
(defcustom lab-ai-model
|
||||||
'("gpt-5-mini"
|
"gpt-5.6-terra"
|
||||||
"gpt-5"
|
"Default model used by Lab-AI."
|
||||||
"gpt-5.5"))
|
:type '(choice
|
||||||
|
(const :tag "GPT-5.6 Luna" "gpt-5.6-luna")
|
||||||
|
(const :tag "GPT-5.6 Terra" "gpt-5.6-terra")
|
||||||
|
(const :tag "GPT-5.6 Sol" "gpt-5.6-sol"))
|
||||||
|
:group 'lab-ai)
|
||||||
|
|
||||||
(defvar lab-ai-model
|
(defcustom lab-ai-image-size
|
||||||
"gpt-5.5")
|
"1024x1024"
|
||||||
|
"Default image size used by Lab-AI."
|
||||||
|
:type '(choice
|
||||||
|
(const "1024x1024")
|
||||||
|
(const "1024x1536")
|
||||||
|
(const "1536x1024"))
|
||||||
|
:group 'lab-ai)
|
||||||
|
|
||||||
(defvar lab-ai-timeout
|
(defcustom lab-ai-timeout
|
||||||
"600")
|
"600"
|
||||||
|
"Timeout in seconds passed to curl."
|
||||||
|
:type 'string
|
||||||
|
:group 'lab-ai)
|
||||||
|
|
||||||
(defvar lab-ai-max-attachment-size
|
(defcustom lab-ai-max-attachment-size
|
||||||
(* 50 1024 1024))
|
(* 5 1024 1024)
|
||||||
|
"Maximum attachment size in bytes."
|
||||||
|
:type 'integer
|
||||||
|
:group 'lab-ai)
|
||||||
|
|
||||||
|
(defcustom lab-ai-chat-history-max-messages
|
||||||
|
200
|
||||||
|
"Maximum number of chat history messages."
|
||||||
|
:type 'integer
|
||||||
|
:group 'lab-ai)
|
||||||
|
|
||||||
(defvar lab-ai-chat-history-max-messages
|
|
||||||
200)
|
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
;; API
|
;; API
|
||||||
@@ -510,6 +539,8 @@ Run again to clear previews."
|
|||||||
#'lab-ai-chat-clear-attachments)
|
#'lab-ai-chat-clear-attachments)
|
||||||
(define-key map (kbd "C-c C-h")
|
(define-key map (kbd "C-c C-h")
|
||||||
#'lab-ai-chat-clear-history)
|
#'lab-ai-chat-clear-history)
|
||||||
|
(define-key map (kbd "C-c C-m")
|
||||||
|
#'lab-ai-switch-model)
|
||||||
map))
|
map))
|
||||||
|
|
||||||
|
|
||||||
@@ -885,13 +916,16 @@ Run again to clear previews."
|
|||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
;; misc
|
;; misc
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
(defun lab-ai-show-model ()
|
||||||
|
(interactive)
|
||||||
|
(message "Lab-AI model: %s" lab-ai-model))
|
||||||
|
|
||||||
(defun lab-ai-switch-model ()
|
(defun lab-ai-switch-model ()
|
||||||
(interactive)
|
(interactive)
|
||||||
(setq lab-ai-model
|
(setq lab-ai-model
|
||||||
(completing-read
|
(completing-read
|
||||||
"Model: "
|
"Model: "
|
||||||
lab-ai-models
|
lab-ai-supported-models
|
||||||
nil t
|
nil t
|
||||||
lab-ai-model))
|
lab-ai-model))
|
||||||
(when (get-buffer lab-ai-chat-buffer)
|
(when (get-buffer lab-ai-chat-buffer)
|
||||||
@@ -899,9 +933,6 @@ Run again to clear previews."
|
|||||||
(lab-ai-chat-update-mode-line)))
|
(lab-ai-chat-update-mode-line)))
|
||||||
(message "lab-ai model => %s" lab-ai-model))
|
(message "lab-ai model => %s" lab-ai-model))
|
||||||
|
|
||||||
(defun lab-ai-show-model ()
|
|
||||||
(interactive)
|
|
||||||
(message "Lab-AI model: %s" lab-ai-model))
|
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
;; Keys
|
;; Keys
|
||||||
|
|||||||
Reference in New Issue
Block a user