Signal · Methods

signal.history

signal.history(messages) sets the conversation history that is sent before the next prompt. Signal keeps no state between calls: each result returns its conversation as history, and passing that to .history() continues the conversation. The model’s replies are scripted; no model is called.

History returned by call 1
[
  {
    role: 'user',
    content: 'Two for The Tempest on Saturday, please. Grace',
  },
  {
    role: 'assistant',
    content: 'Two seats on Saturday, Grace. Anything else?',
  },
]
Prompt, call 2
'Make it three.'
Request messages, call 2
[
  {
    role: 'user',
    content: 'Two for The Tempest on Saturday, please. Grace',
  },
  {
    role: 'assistant',
    content: 'Two seats on Saturday, Grace. Anything else?',
  },
  { role: 'user', content: 'Make it three.' },
]
Output matches the expected value

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