LLM helpers
Short model names and one-shot completion helpers for aai-pyskills.
models maps short names to full 'vendor/model' specs (built from fastllm.types). ask runs a one-shot completion via fastllm: pass a short name or any full spec, and get the response text back.
response_text
def response_text(
res
):
The visible text of an acomplete result: its message's text parts joined (thinking parts skipped).
ask
async def ask(
prompt, # The user message
model:str='sonnet', # A `models` short name, or any full 'vendor/model' spec
system=None, # Optional system prompt
effort=None, # Reasoning effort where the model supports it: 'low'/'medium'/'high'
max_tokens:int=8192, # Response cap; fastllm's own defaults are small
**kwargs
):
One-shot completion returning the response text.