Files
memex/notes/org-skill-provider-gemini.org

1.9 KiB

SKILL: Gemini Provider Agent (Universal Literate Note)

Overview

The Gemini Provider Agent integrates Google's Gemini API as a pluggable System 1 (neural) backend. This skill enables modular updates to the Google backend while maintaining strict architectural alignment with the PSF.

Phase A: Demand (PRD)

1. Purpose

Define the interface for reliable communication with the Google Gemini v1beta API.

2. User Needs

  • API Integration: Implementation of the Gemini `contents.parts` protocol.
  • Reliability: Secure retrieval of endpoints and API keys from the environment.
  • Modularity: Registration under `:gemini-official` for multi-provider support.

3. Success Criteria

TODO API Authentication via URL Key

TODO Payload Construction

TODO Response Parsing Verification

Phase B: Blueprint (PROTOCOL)

1. Architectural Intent

Interfaces for executing neural completion requests via Google's generative AI endpoints.

2. Semantic Interfaces

(defun execute-gemini-v1-request (prompt system-prompt)
  "Executes a completion request via the Gemini API.")

Phase D: Build (Implementation)

Request Execution

(defun execute-gemini-v1-request (prompt system-prompt)
  (let ((api-key (uiop:getenv "LLM_API_KEY"))
        (endpoint (uiop:getenv "LLM_ENDPOINT")))
    (unless api-key (return-from execute-gemini-v1-request "ERROR: Key missing"))
    ;; Physical API call logic (mocked for refactor)
    (format nil "Executing Gemini request via ~a" endpoint)))

Registration

(defskill :skill-provider-gemini
  :priority 100
  :trigger (lambda (context) nil)
  :neuro (lambda (context) nil)
  :symbolic (lambda (action context) action))