Type alias FormattedPrompt

FormattedPrompt: ChatMessage[] | string | {
    messages: ChatMessage[];
    system?: string;
    tools?: any[];
    [key: string]: any;
}

The final formatted prompt ready for submission to an LLM provider. The structure varies based on the target model's requirements.

  • ChatMessage[]: For models like OpenAI Chat.
  • string: For older text completion models.
  • object: For models with more complex input structures (e.g., Anthropic Messages API which takes an object with messages and system).

Type declaration

  • [key: string]: any
  • messages: ChatMessage[]
  • Optional system?: string
  • Optional tools?: any[]