Prompts

AI models must be prompted to provide a solution for a given problem. For this, the extension provides a basic abstraction to implement such prompts.

See also

Read more about techniques to improve reliability when it comes to prompt engineering.

interface EliasHaeussler\Typo3Solver\ProblemSolving\Solution\Prompt\Prompt

Basic abstraction to generate prompts for a given problem. Ideally, prompts are developed to match a specific model.

static create

Create a new instance of the prompt generator. This is mainly used on a low level basis where dependency injection is not available.

Returns

An instance of the current prompt generator.

generate($exception)

Generate a prompt to provide a solution for the given exception.

Parameters
  • $exception (Throwable) -- The exception to generate a prompt for

Return type

string

Default prompt

The extension already ships a default prompt, targeting the GPT-3.5 model.

class EliasHaeussler\Typo3Solver\ProblemSolving\Solution\Prompt\DefaultPrompt

Default prompt generator, mainly developed for the GPT-3.5 model, but can be used for other models as well. It passes the following information to the OpenAI model:

  • Exception class

  • Exception message

  • File where the exception was triggered

  • Line where the exception was triggered

  • Code snippet of the line that triggered the exception

  • Installation mode (composer or legacy)

  • Installed TYPO3 version

  • Installed PHP version

See also

View the sources on GitHub: