Class: OrchestraAI::Prompt::Summarize

Inherits:
Object
  • Object
show all
Defined in:
lib/orchestra_ai/prompt/summarize.rb

Instance Method Summary collapse

Constructor Details

#initialize(results:) ⇒ Summarize

Returns a new instance of Summarize.



6
7
8
# File 'lib/orchestra_ai/prompt/summarize.rb', line 6

def initialize(results:)
  @results = results
end

Instance Method Details

#to_sObject



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/orchestra_ai/prompt/summarize.rb', line 10

def to_s
  "    <Instruction>\n      <Item>\n        The workflow has been executed. Here are the results:\n        \#{\n          @results.map { |r|\n            \"Task: \#{r.action.key}, Params: \#{r.action.class.arguments.to_json}, Result: \#{r.result}\"\n          }.join(\"\\n\")\n        }\n        Now, please summarize the results in a single JSON object\n      </Item>\n    </Instruction>\n\n    <Example type=\"success\">\n      <Message>\n        I have created a folder named \"My Folder\" and a post titled \"My Post\" with content \"This is my post\" in the folder \"My Folder\"\n      </Message>\n    </Example>\n  XML\nend\n"