Skip to content

Commit 1aafa60

Browse files
authored
Simplify github models to be based of llm-azure (#147)
1 parent d86a8ca commit 1aafa60

File tree

1 file changed

+4
-19
lines changed

1 file changed

+4
-19
lines changed

llm-github.el

+4-19
Original file line numberDiff line numberDiff line change
@@ -26,28 +26,13 @@
2626
;;; Code:
2727

2828
(require 'llm)
29-
(require 'llm-openai)
30-
(require 'cl-lib)
29+
(require 'llm-azure)
3130

32-
(cl-defstruct (llm-github (:include llm-openai-compatible (url "https://models.inference.ai.azure.com"))))
33-
34-
(cl-defmethod llm-nonfree-message-info ((_ llm-github))
35-
"Return GitHub's nonfree terms of service."
36-
"https://docs.github.com/en/site-policy/github-terms/github-terms-of-service")
31+
(cl-defstruct (llm-github (:include llm-azure
32+
(url "https://models.inference.ai.azure.com"))))
3733

3834
(cl-defmethod llm-provider-chat-url ((provider llm-github))
39-
(format "%s/chat/completions"
40-
(llm-github-url provider)))
41-
42-
(cl-defmethod llm-provider-embedding-url ((provider llm-github) &optional _)
43-
(format "%s/embeddings/"
44-
(llm-github-url provider)))
45-
46-
(cl-defmethod llm-provider-headers ((provider llm-github))
47-
`(("api-key" . ,(llm-github-key provider))))
48-
49-
(cl-defmethod llm-capabilities ((_ llm-github))
50-
(list 'streaming 'embedding))
35+
(format "%s/chat/completions" (llm-azure-url provider)))
5136

5237
(cl-defmethod llm-name ((provider llm-github))
5338
(format "GitHub Models %s" (llm-github-chat-model provider)))

0 commit comments

Comments
 (0)