# LLM Input Annotations (Beta)

## Using `@InTestsUseLLM`

The `@InTestsUseLLM` annotation allows you to request inputs from a configured LLM connection in order to provide more creative inputs for tests of a particular method under test. More creative values can often provide cosmetically better tests, but can sometimes lead to improved test strength through better assertions, and potentially improved coverage. See [LLM Configuration (Beta)](/features/cover-cli/environment-configuration/llm-configuration.md) to configure the LLM connection & credentials.

The annotation can be located on a method, class or package to identify the scope of methods under test where LLMs should be consulted. For example the following method validates credit card numbers and is annotated such that the LLM can provide some realistic and valid credit card numbers:

```java
/**
 * Validates a credit card number using the Luhn algorithm.
 * <p>
 * This method sanitizes the input by removing spaces and hyphens, 
 * then checks if the number passes the Luhn checksum.
 * It does not check card type or length.
 *
 * @param cardNumber the credit card number as a String; spaces and hyphens are allowed
 * @return true if the card number is valid according to the Luhn algorithm, false otherwise
 */
@InTestsUseLLM
public static boolean isValidCreditCardNumber(String cardNumber) {
    // ...
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://cover-docs-preview.diffblue.com/features/cover-annotations/llm-input-annotations-beta.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
