Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details

Using DeepSeek with QlikSense, prompt by input text

cancel
Showing results for 
Search instead for 
Did you mean: 
eddyvargas
Contributor III
Contributor III

Using DeepSeek with QlikSense, prompt by input text

Last Update:

Feb 25, 2025 7:49:35 PM

Updated By:

eddyvargas

Created date:

Feb 25, 2025 7:49:35 PM

Before you start writing: Public articles must follow our Content Standard. See the Content Guidelines for the bare minimum standard and our Contend Standard for a detailed breakdown. Do not publish directly. Submit your article for review or for publication to have it reviewed by a subject matter expert or writer. 

Configure and use deepseek with QlikSense Saas

Connector Config Rest

eddyvargas_0-1740530281027.png

Request body:

{
"model": "deepseek-chat",
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Hello!"}
],
"stream": false
}

eddyvargas_1-1740530463781.png

after Bearer you wirte your API Key generated in https://platform.deepseek.com/api_keys

Script in your app:

vG_inputData = Replace(vinputtext,chr(34),'');

vResponseBody='
{
        "model": "deepseek-chat",
        "messages": [
          {"role": "system", "content": "You are a helpful assistant."},
          {"role": "user", "content": "$(vG_inputData)"}
        ],
        "stream": false
      }
';
 
vResponseBody=Replace(vResponseBody,'"',chr(34)&chr(34));
LIB CONNECT TO 'deepseek'; //conn Name
 
RestConnectorMasterTable:
SQL SELECT 
"id",
"object",
"created",
"model",
"system_fingerprint",
"__KEY_root",
(SELECT 
"index",
"logprobs",
"finish_reason",
"__KEY_choices",
"__FK_choices",
(SELECT 
"role",
"content",
"__FK_message"
FROM "message" FK "__FK_message")
FROM "choices" PK "__KEY_choices" FK "__FK_choices"),
(SELECT 
"prompt_tokens",
"completion_tokens",
"total_tokens",
"prompt_cache_hit_tokens",
"prompt_cache_miss_tokens",
"__KEY_usage",
"__FK_usage",
(SELECT 
"cached_tokens",
"__FK_prompt_tokens_details"
FROM "prompt_tokens_details" FK "__FK_prompt_tokens_details")
FROM "usage" PK "__KEY_usage" FK "__FK_usage")
FROM JSON (wrap on) "root" PK "__KEY_root"
 
WITH CONNECTION (BODY "$(vResponseBody)");
 
[message]:
LOAD [role],
[content],
[__FK_message] AS [__KEY_choices]
RESIDENT RestConnectorMasterTable
WHERE NOT IsNull([__FK_message]);
 
 
[choices]:
LOAD [index],
[logprobs],
[finish_reason],
[__KEY_choices],
[__FK_choices] AS [__KEY_root]
RESIDENT RestConnectorMasterTable
WHERE NOT IsNull([__FK_choices]);
 
 
[prompt_tokens_details]:
LOAD [cached_tokens],
[__FK_prompt_tokens_details] AS [__KEY_usage]
RESIDENT RestConnectorMasterTable
WHERE NOT IsNull([__FK_prompt_tokens_details]);
 
 
[usage]:
LOAD [prompt_tokens],
[completion_tokens],
[total_tokens],
[prompt_cache_hit_tokens],
[prompt_cache_miss_tokens],
[__KEY_usage],
[__FK_usage] AS [__KEY_root]
RESIDENT RestConnectorMasterTable
WHERE NOT IsNull([__FK_usage]);
 
 
[root]:
LOAD [id],
[object],
[created],
[model],
[system_fingerprint],
[__KEY_root]
RESIDENT RestConnectorMasterTable
WHERE NOT IsNull([__KEY_root]);
 
 
DROP TABLE RestConnectorMasterTable;
 
Dashboard:
eddyvargas_2-1740530766848.png

 

Use variable input to modify vinputtext

 

Labels (2)
Comments
Josefilhorv
Partner - Contributor
Partner - Contributor

Thanks

Contributors
Version history
Last update:
‎2025-02-25 07:49 PM
Updated by: