Signal · Methods

signal.complete

signal.complete(prompt) sends the request, waits for the full response and returns response, history (the conversation history to pass to the next call) and meta. meta.usage holds the token counts the provider reports; meta also has durationMs and provider, omitted from the output here. The model’s reply is scripted and reports zero tokens; no model is called.

Prompt
'Which nights does The Tempest play?'
Scripted model reply
On Friday and on Saturday, at half past seven.
Output
{
  response: 'On Friday and on Saturday, at half past seven.',
  history: [
    {
      role: 'user',
      content: 'Which nights does The Tempest play?',
    },
    {
      role: 'assistant',
      content: 'On Friday and on Saturday, at half past seven.',
    },
  ],
  meta: {
    model: 'written-here',
    usage: { inputTokens: 0, outputTokens: 0, totalTokens: 0 },
    retries: 0,
    toolCalls: [],
  },
}
Output matches the expected value

Runs in this page on the installed package. The input and the expected output are defined by the example.