File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -43,12 +43,26 @@ public function context(array $context): self
4343 return $ this ;
4444 }
4545
46+ public function withCustomBaseInstruction (string $ instruction ): self
47+ {
48+ $ this ->baseInstruction = $ instruction ;
49+
50+ return $ this ;
51+ }
52+
53+ public function withAdditionalInstruction (string $ instruction ): self
54+ {
55+ $ this ->baseInstruction = $ this ->baseInstruction . ' ' .$ instruction ;
56+
57+ return $ this ;
58+ }
59+
4660 public function buildPrompt (): self
4761 {
4862 $ context = $ this ->contextString ();
4963 $ responseInstruction = $ this ->responseInstructionString ();
5064
51- $ this ->prompt = "Analyze for {$ this ->subject }: \"{$ this ->text }\". {$ context } {$ this ->baseInstruction } {$ responseInstruction }" ;
65+ $ this ->prompt = "Analyze for {$ this ->subject }: \"{$ this ->text }\". {$ context } Instruction: {$ this ->baseInstruction }. Response instruction: {$ responseInstruction }" ;
5266
5367 return $ this ;
5468 }
You can’t perform that action at this time.
0 commit comments