@description
The @description attribute provides additional context to fields or values in prompts.
Class Field Description
Without @description
class MyClass {
property1 string
}
ctx.output_format:
{
property1: string
}
With @description
class MyClass {
property1 string @description("The name of the object")
}
ctx.output_format:
{
// The name of the object
property1: string
}
Enum Value Description
Without @description
enum MyEnum {
Value1
Value2
}
ctx.output_format:
MyEnum
---
Value1
Value2
With @description
enum MyEnum {
Value1 @description("The first value")
Value2 @description("The second value")
}
ctx.output_format:
MyEnum
---
Value1: The first value
Value2: The second value
Enum Description (Block-Level)
enum MyEnum {
Value1
Value2
@@description("This enum represents status codes")
}
ctx.output_format:
MyEnum: This enum represents status codes
---
Value1
Value2
Use Cases
- Add context to help LLM understand field purpose
- Document expected values or formats
- Provide examples or constraints