Skip to main content

Params

This page documents all the attributes that may be used in a dynamic Attribute.

Parameters

The following table provides details about the parameters available for dynamic attributes.

NameTypeAvailabilityDescription
userInputstringAll Dynamic AttributesA string representing the user's input in the chat.
prevPathstringAll Dynamic AttributesA string representing the previous path in the chat (can be null if not found).
injectMessageasync functionAll Dynamic AttributesA utility function used to inject a message into the chat which takes in 3 properties as represented by the Message type.
streamMessageasync functionAll Dynamic AttributesA utility function used to stream messages into the chat which takes in 3 properties as represented by the Message type and you may refer to this example for more details.
openChatfunctionAll Dynamic AttributesA utility function used to control the visibility of the chat component. It takes one parameter:
  • isOpen:
  • A boolean indicating whether the chat should be opened (true) or closed (false).
filesFileListOnly file AttributeA list of file(s) uploaded by the user.
Caution

If you are using params.injectMessage or params.streamMessage, do remember that they are async and that without using await, behavior may be unexpected (e.g. multiple messages sent at once). This is a common pitfall!

Tip

Do consider checking out the examples if you need more clarity on the usages of params.