Function personaFromAgentOptions

  • Builds the persona of a GMI from agent options.

    Parameters

    • opts: AgentOptions

      The agent's options.

    • cognition: ResolvedCognition

      The resolved profile (resolveCognition): sentiment tracking, metaprompts, and whether learning is on.

    • tools: ITool<any, any>[]

      The agent's tools, adapted: they decide the persona's capabilities.

    Returns IPersonaDefinition

    The persona. With cognition.learning set its base prompt has no personality section: a GMI built from it sends the section only when it is given a learner session (GMIBaseConfig.learning) or the persona's traits (GMIBaseConfig.personaTraits), as gmi() gives it.

    Throws

    When no provider or model can be resolved, as generateText throws.