-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Labels
Description
One still-open design question in handlers.llm is where the system prompt should come from in the context of our overall semantics.
Currently we treat it as optional context injected dynamically by a handler InstructionsHandler, but we might wonder whether there is a natural host language construct corresponding to the system prompt analogous to our function-scope user prompts.
The obvious candidate for this would seem to be the top-level docstring of the enclosing lexical scope around a Template definition (which is generally either a function, a class definition or a module). There are several variants to consider:
- The innermost enclosing frame's docstring (e.g. the docstring of the class body on which the
Templateis defined) - The innermost non-null docstring of an enclosing frame
- The module-level global frame's docstring (e.g. the docstring of the module in which the
Templateis defined) - The concatenation along the lexical frame stack from global to local (e.g. the module docstring followed by the class docstring)
Of these, (4) is the most general and has nice compositional structure.
Reactions are currently unavailable