This topic describes how to display deep thinking content from the DeepSeek model in the chat widget.
Use a Model Studio agent application integration resource
This example applies to applications that use a Model Studio agent application to build business logic. If you publish applications directly from the Model Studio platform through the BC channel or start applications using the 'Enterprise Q&A' or 'Personal Cloud Assistant' templates, see the following adaptation tutorials:
In the Model Studio console, go to My Applications > Agent Application. Set the foundation model to 'DeepSeek-R1', and then save and publish the application.
Create an integration resource for the Model Studio agent application and enter the Model Studio platform API key. For more information, see Get an API key.
In the BC integration operation, select the integration resource for the Model Studio agent application that you created. Configure the Model Studio application ID and other settings. You can find the application ID on the application card in the Model Studio console. Replace the script in the data transform with the following code:
/**
* Retain only the text and adapt the reasoning text for the DeepSeek model.
*/
const reasoning = data?.thoughts?.find(el => el?.action_type === "reasoning");
const isThinkReady = data?.text !== '';
return reasoning ? '<think>\n\n' + reasoning?.response + (reasoning && isThinkReady ? '</think>\n\n' : '') + (data.text || '') : (data?.text || '');
Attach this integration operation to the chat widget and enable 'BC enhanced rendering' to display HTML content.
Integrating resources with large models in Model Studio
This example applies to applications that use a Model Studio Large Language Model (LLM) to build business logic. If you build application logic by directly invoking a Model Studio foundation model, see the following adaptation tutorials:
In the integration operation, select a model from the DeepSeek series.
Attach this integration operation to the chat widget and enable 'BC enhanced rendering' to display HTML content.