Skip to main content

agent-prompts

Documentation / agents/agent-prompts

Generate​

getAgentPrompts()​

function getAgentPrompts(agentName: any, options?: any): 
| {
name: string;
prompt: string;
tools: any[];
}
| {
error: string;
};

Defined in: agents/agent-prompts.ts:40

Agent Prompts​

  1. summarize-bullets:
    • article
  2. summarize:
    • article
  3. suggest-followups:
    • chat_history
    • article
  4. answer:
    • chat_history
    • query
  5. query-resolution:
    • chat_history
    • query
  6. knowledge-graph-nodes:
    • query
    • article
  7. summary-longtext:
    • article
    • sections

Returns an object with agent prompts based on the provided agent name and options Uses regex to detect any variables in %7Bbrackets%7D in the prompts and replace them with values from the options object Values inside brackets must be the matching variable name

Parameters​

ParameterTypeDescription

agentName

any

The name of the agent to generate prompts for.

options?

any

An options object that can contain the following properties:

  • context: An object containing context variables to be used when generating the prompts.variablesNotProvided

Returns​

| { name: string; prompt: string; tools: any[]; } | { error: string; }

An object with agent prompts.

Author​

ai-research-agent (2024)

Example​

var prompt = getAgentPrompts("summarize-bullets", {article})