> ## Documentation Index
> Fetch the complete documentation index at: https://docs.chainlit.io/llms.txt
> Use this file to discover all available pages before exploring further.

# author_rename and Message author

This documentation covers two methods for setting or renaming the author of a message to display more friendly author names in the UI: the `author_rename` decorator and the Message author specification at message creation.

## Method 1: author\_rename

Useful for renaming the author of a message dynamically during the message handling process.

## Parameters

<ParamField path="orig_author" type="str" required>
  The original author name.
</ParamField>

## Returns

<ResponseField name="author" type="str" required>
  The renamed author
</ResponseField>

## Usage

```python theme={null}
from langchain import OpenAI, LLMMathChain
import chainlit as cl


@cl.author_rename
def rename(orig_author: str):
    rename_dict = {"LLMMathChain": "Albert Einstein", "Chatbot": "Assistant"}
    return rename_dict.get(orig_author, orig_author)


@cl.on_message
async def main(message: cl.Message):
    llm = OpenAI(temperature=0)
    llm_math = LLMMathChain.from_llm(llm=llm)
    res = await llm_math.acall(message.content, callbacks=[cl.AsyncLangchainCallbackHandler()])

    await cl.Message(content="Hello").send()
```

## Method 2: Message author

Allows for naming the author of a message at the moment of the message creation.

### Usage

You can specify the author directly when creating a new message object:

```python theme={null}
from langchain import OpenAI, LLMMathChain
import chainlit as cl

@cl.on_message
async def main(message: cl.Message):
    llm = OpenAI(temperature=0)
    llm_math = LLMMathChain.from_llm(llm=llm)
    res = await llm_math.acall(message.content, callbacks=[cl.AsyncLangchainCallbackHandler()])

    # Specify the author at message creation
    response_message = cl.Message(content="Hello", author="NewChatBotName")
    await response_message.send()
```
