# new AiTextarea(config)
Its a Custom Web Component. Do not use the constructor directly with the new keyword. Instead, use one of the 3 following methods:
Create the Web Component and call its init method:
const myAiTextareaField = document.createElement("a-aitextarea").init(config)
Or use a shorthand to create one the various field types:
const myAiTextArea = createAiTextareaField({
label: "I'm a long text field",
cols: 100,
rows: 10
})
Or directly declare the config inside a container component:
const myPanel = createPanel({
title: "My panel",
items: [
{
type: "aitextarea",
label: "I'm an AI textarea"
}
]
})
myPanel.render()
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
config |
object
|
||
iconColorOn |
string
|
<optional> |
Icon color |
ai |
object
|
<optional> |
Optional AI default configuration |
ai.who |
string
|
<optional> |
Default persona: "-" | "sales manager" | "hr manager" | "marketing manager" | "product manager" |
ai.what |
string
|
<optional> |
Default task: "-" | "draft a blog post" | "summup a text" | "convert to tweet" | "write an email" | "create user persona" | "create job description" |
ai.tone |
string
|
<optional> |
Default tone: "casual" | "formal" | "humour" | "ironic" |
ai.goal |
string
|
<optional> |
Default goal: "-" | "inform" | "persuade" | "inspire" |
ai.temperature |
number
|
<optional> |
OpenAI creativity, from 0 to 1 |
ai.max_tokens |
number
|
<optional> |
Max number of tokens for OpenAI answer |
this
Generated markup
<a-aitextarea class="a-aitextarea">
<span class="field-label"></span>
<textarea class="field-input"></textarea>
</a-aitextarea>