Skip to content

Commit 75aeb7a

Browse files
committed
add option to alter instruction
1 parent 7b6ddff commit 75aeb7a

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

src/Checks/Check.php

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)