| |
String ask(String message, String configName, Double temperature, Double topP, Integer topK, Double frequencyPenalty, Double presencePenalty, Integer maxOutputTokens, List<String> stopSequences, Integer timeoutMs) throws TestException |
| Parameters |
message |
The message to send to the LLM.
|
configurationName |
The name of a LLM configuration as set in LLM Configurations in the QF-Test options
|
temperature |
Controls the randomness of the generated text.
|
topK |
Controls how many of the most likely tokens should be considered.
|
topP |
Controls which tokens should be considered.
|
presencePenalty |
Prevents the llm from reusing words.
|
frequencyPenalty |
Prevents the llm from repeating words.
|
maxOutputTokens |
Maximum number of tokens that can be generated in the response.
|
stopSequences |
Prevent LLM from generating more text after that string appears.
|
timeoutMs |
How long to wait for a response from the LLM, in milliseconds.
|
| Returns |
The answer from the LLM as a string.
|
| |
void addCustomModel(final String name, final Object responseFunction) |
| Parameters |
name |
The AI configuration name under which the custom model can be referenced
|
responseFunction |
A function which receives the query – its first parameter is the request itself, an optional second parameter holds the request parameters
|
| |
void removeCustomModel(final String name) |
| Parameters |
name |
The name under which the custom model was registered
|
| |
List<String> getConfigNames() |
| Returns |
A List of all available AI configuration names
|
| |
void setDefaultConfig(String provider, String baseUrl, String apiKey, String modelName, String displayName="Default") |
| Parameters |
provider |
Currently available provider types: OpenAIGeneric, Anthropic, Gemini and Ollama.
|
baseUrl |
The base API URL endpoint to the provider. Usually ends with /v1 oder similar.
|
apiKey |
The API key to submit to the provider.
|
modelName |
The name of the model to use, like gpt-4o or gemini-2.0-flash.
|
displayName |
How QF-Test will identify the configuration in logs and error messages, defaults to Default
|
| |
void resetDefaultConfig() |
| |