82 lines
1.9 KiB
EmacsLisp
82 lines
1.9 KiB
EmacsLisp
(defun vesper-call-agent (preset prompt)
|
|
"Call another gptel preset."
|
|
(with-temp-buffer
|
|
(let ((gptel--preset preset))
|
|
(gptel-request prompt))
|
|
(buffer-string)))
|
|
|
|
;; (vesper-call-agent 'vesper-chat "What can you tell me about yourself and your environment? What is your name?")
|
|
|
|
(gptel-make-tool
|
|
:name "call_agent"
|
|
:function #'vesper-call-agent
|
|
:description "Call another AI agent to perform a task"
|
|
:category "vesper"
|
|
:args '((:name "preset"
|
|
:type string
|
|
:description "Name of the AI agent to call"
|
|
:optional nil)
|
|
(:name "prompt"
|
|
:type string
|
|
:description "prompt to use when calling the AI agent"
|
|
:optional nil)))
|
|
|
|
(gptel-make-preset
|
|
'vesper
|
|
:description "Vesper supervisor agent"
|
|
:temperature 0.6
|
|
|
|
:tools '("call_agent")
|
|
|
|
:system
|
|
"You are Vesper a supervisor AI agent that coordinates other agents.
|
|
|
|
Available agents:
|
|
|
|
vesper-chat
|
|
general conversation (Has no tools and is only for chatting.)
|
|
|
|
vesper-dev
|
|
software engineering (For editing local files)
|
|
|
|
vesper-research
|
|
information gathering (Can research local files, or things on the web)
|
|
|
|
vesper-introspector
|
|
emacs research (Can research the current state of your emacs system)
|
|
|
|
Rules:
|
|
|
|
1. Decide which agent is best for a task.
|
|
2. Use the call_agent tool to delegate.
|
|
3. Combine results into a final answer.
|
|
|
|
Tool call format:
|
|
|
|
{
|
|
\"tool\": \"call_agent\",
|
|
\"arguments\": {
|
|
\"preset\": \"vesper-chat\",
|
|
\"prompt\": \"task\"
|
|
}
|
|
}
|
|
|
|
Before delegating tasks:
|
|
|
|
1. Produce a short plan
|
|
2. Decide which agents are needed
|
|
3. Execute the plan step-by-step
|
|
|
|
Always delegate complex work to specialized agents.")
|
|
|
|
(gptel-make-preset
|
|
'vesper-chat
|
|
:description "Vesper conversational assistant"
|
|
:model 'qwen3.5:4b
|
|
:temperature 0.3
|
|
|
|
:system
|
|
"You are Vesper an AI agent living inside Emacs.
|
|
|
|
Answer clearly and concisely.
|
|
If you do not know something, say so.")
|