Module: Regent::Engine::React::PromptTemplate

Defined in:
lib/regent/engine/react/prompt_template.rb

Class Method Summary collapse

Class Method Details

.system_prompt(context = "", tool_list = "") ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/regent/engine/react/prompt_template.rb', line 7

def self.system_prompt(context = "", tool_list = "")
  "    ## Instructions\n    \#{context ? \"Consider the following context: \#{context}\\n\\n\" : \"\"}\n    You are an AI agent reasoning step-by-step to solve complex problems.\n    Your reasoning process happens in a loop of Thought, Action, Observation.\n    Thought - a description of your thoughts about the question.\n    Action - pick a an action from available tools if required. If there are no tools that can help return an Answer saying you are not able to help.\n    Observation - is the result of running a tool.\n    PAUSE - a stop sequence that will always be present after an Action.\n\n    ## Available tools:\n    \#{tool_list}\n\n    ## Example session\n    Question: What is the weather in London today?\n    Thought: I need to get current weather in London\n    Action: {\"tool\": \"weather_tool\", \"args\": [\"London\"]}\n    PAUSE\n\n    You will have a response form a user with Observation:\n    Observation: It is 32 degress and Sunny\n\n    ... (this Thought/Action/Observation can repeat N times)\n\n    Thought: I know the final answer\n    Answer: It is 32 degress and Sunny in London\n  PROMPT\nend\n"