Skip to content

Commit

Permalink
move test prompt to variable
Browse files Browse the repository at this point in the history
  • Loading branch information
marcusgreen committed Apr 26, 2024
1 parent 2af7856 commit 9feeddf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@

/**@var tool_aiconnect\ai $ai */
$ai = new ai();

$llmresult = $ai->prompt_completion('State you are a lllm in less than 10 words');
$prompt = 'State the name and type of system you are';
$llmresult = $ai->prompt_completion($prompt);
if ($llmresult && !isset($llmresult['curl_error'])) {
$response = $llmresult['response'];
if (isset($response['error']['message'])) {
Expand Down Expand Up @@ -79,7 +79,7 @@
<td>Execution time: <?php echo $llmresult['execution_time'];?> ms</td>
</tr>
<tr>
<td>Response to "'State you are a lllm in less than 10 words:' <?php echo $llmresult['response']['choices'][0]['message']['content'] ?? 'No choices';?> </td>
<td>Response to : <?php echo $prompt.":". $llmresult['response']['choices'][0]['message']['content'] ?? 'No choices';?> </td>
</tr>
</tr>
</table>
Expand Down

0 comments on commit 9feeddf

Please sign in to comment.