Chat Service (beta)
Inline Attribution Formatter
Chat answers contain inline attributions and uses
DefaultFormatter
by default.
Example:
Output:
DefaultFormatter
adds inline attributes as a
`:ref[index]`
where index
is an index of
inline attribution element in sources
property in
ChatInteraction
There are two formatters available at the moment and it is also possible to create custom formatter
- DefaultFormatter
- MarkdownLinkFormatter
How to configure it
You can configure the inline attribution formatter at different levels:
- When chat is created
- When getting existing chat
- When getting list of chats
- When making
chat.ask
request
When chat is created
When getting existing chat
When getting list of available chats
When making chat.ask
request
In case it’s necessary to chage formatter only for one
chat.ask
call there is a possibility:
Create a custom formatter
It is possible to create custom inline attribution formatter.
All inline attribution formatters extend abstract class
InlineAttributionFormatter
It is necessary to implement format
method.
Here an example how to create custom formatter:
Output: