|
30 | 30 | ;;; API |
31 | 31 |
|
32 | 32 | ;;;###autoload |
33 | | -(cl-defun google-gemini-model ( name |
| 33 | +(cl-defun google-gemini-model ( model |
34 | 34 | callback |
35 | 35 | &key |
| 36 | + (parameters google-gemini-parameters) |
36 | 37 | (key google-gemini-key)) |
37 | | - "Send request to get model information." |
| 38 | + "Send request to get model information. |
| 39 | +
|
| 40 | +Arguments MODEL and CALLBACK are required for this type of request. |
| 41 | +MODEL is the name of the model. CALLBACK is the execuation after request |
| 42 | +is made. |
| 43 | +
|
| 44 | +Arguments PARAMETERS, and KEY are global options; however, you can overwrite the |
| 45 | +value by passing it in." |
38 | 46 | (google-gemini-request (concat google-gemini-generativelanguage-url |
39 | | - "v1beta/models/" name "?key=" |
| 47 | + "v1beta/models/" model "?key=" |
40 | 48 | key) |
41 | 49 | :type "GET" |
| 50 | + :params parameters |
42 | 51 | :parser 'json-read |
43 | 52 | :complete (cl-function |
44 | 53 | (lambda (&key data &allow-other-keys) |
|
47 | 56 | ;;;###autoload |
48 | 57 | (cl-defun google-gemini-models ( callback |
49 | 58 | &key |
| 59 | + (parameters google-gemini-parameters) |
50 | 60 | (key google-gemini-key)) |
51 | | - "Send request to get a list of supported models." |
| 61 | + "Send request to get a list of supported models. |
| 62 | +
|
| 63 | +Arguments CALLBACK is required for this type of request. |
| 64 | +CALLBACK is the execuation after request is made. |
| 65 | +
|
| 66 | +Arguments PARAMETERS, and KEY are global options; however, you can overwrite the |
| 67 | +value by passing it in." |
52 | 68 | (google-gemini-request (concat google-gemini-generativelanguage-url |
53 | 69 | "v1beta/models?key=" |
54 | 70 | key) |
55 | 71 | :type "GET" |
| 72 | + :params parameters |
56 | 73 | :parser 'json-read |
57 | 74 | :complete (cl-function |
58 | 75 | (lambda (&key data &allow-other-keys) |
|
65 | 82 | (defun google-gemini-model-info () |
66 | 83 | "Print a model information." |
67 | 84 | (interactive) |
68 | | - (if-let ((name (read-string "Name of the model: " "gemini-pro"))) |
69 | | - (google-gemini-model name (lambda (data) (message "%s" data))) |
| 85 | + (if-let ((model (read-string "Name of the model: " "gemini-pro"))) |
| 86 | + (google-gemini-model model (lambda (data) (message "%s" data))) |
70 | 87 | (user-error "Abort, cancel get model info operation"))) |
71 | 88 |
|
72 | 89 | (defvar google-gemini-model-entries nil |
|
0 commit comments