Skip to content

Commit 18a23dd

Browse files
committed
new LLMs
1 parent 797d7bc commit 18a23dd

5 files changed

Lines changed: 111 additions & 20 deletions

File tree

dashjoin-docs/docs/appendix-configurations.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,16 @@ EMPLOYEES table defines the record label to be the LAST_NAME. All links and page
142142
}
143143
}
144144
```
145+
### KnowledgeBase
146+
Expose the RAG document knowledge base to the platform
147+
```json
148+
{
149+
"ID" : "dj/kb",
150+
"name" : "kb",
151+
"djClassName" : "com.dashjoin.ai.KnowledgeBase",
152+
"url" : "http://localhost:8001"
153+
}
154+
```
145155
## Function Catalog
146156
### Invoke
147157
Function that adds two numbers passed in the argument object. It can be called via $call('add') or via REST
@@ -215,6 +225,30 @@ Configures an SMTP server
215225
"password" : "DJ1#\btW06MCaBJjnRvgvGgTaTpQ=="
216226
}
217227
```
228+
### MCPServer
229+
Configures an MCP server
230+
```json
231+
{
232+
"djClassName" : "org.dashjoin.function.MCPServer",
233+
"ID" : "mcp",
234+
"url" : "https://mcp.notion.com/mcp",
235+
"username" : "Authorization",
236+
"password" : "DJ1#\b7Zw3EGtmVKaDuwwOtwXfWDG1y+awbon7WNQp9NmJ6EgUXEpYUMC8O7zRUw2kSnDxyATO0R3ke3NxjaT9zCwYyDGS5VDgYt/L",
237+
"apiKey" : true
238+
}
239+
```
240+
### AIApp
241+
Configures an AI application with system prompt, tools, and RAG
242+
```json
243+
{
244+
"ID" : "aia",
245+
"djClassName" : "com.dashjoin.ai.AIApp",
246+
"systemPrompt" : "You are a helpful assistant",
247+
"tools" : [ "time:get_current_time" ],
248+
"model" : "mistral",
249+
"documents" : [ "rag.txt" ]
250+
}
251+
```
218252
## Configuration
219253
### login configuration
220254
Login configuration for ACME Corp. App with a specific login screen background image. Users can choose between the 'de' and 'en' locales. The default is the browser locale.

dashjoin-docs/docs/appendix-jsonata.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,15 @@ Sample output:
138138
```json
139139
null
140140
```
141+
### sse
142+
Calls the AIApp function called aia with messages. Use only in the AIChat widget's onChat expression
143+
```
144+
$sse('aia', [{'role': 'user', 'content': 'hi there'}])
145+
```
146+
Sample output:
147+
```json
148+
null
149+
```
141150
### stopSpeech
142151
stops any text to speech that's in progress
143152
```

dashjoin-docs/docs/appendix-widgets.md

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -379,32 +379,22 @@ Visualizes 'expression' as a table. The 'properties' field contains an object wh
379379
}
380380
```
381381
## aichat widget
382-
chat widget that allows you to react to user inputs and file uploads. this example answers (without AI) by simply repeating what the user asks.
382+
chat widget that allows you to react to user inputs and file uploads. this example answers (without AI) by simply repeating what the user asks. the chat is initialized with a simple message
383383
```json
384384
{
385-
"onChat" : "$append(messages, [{'role':'user', 'content': query}, {'role':'assistant', 'content': 'you said: ' & query}])",
385+
"onChat" : "newMessage.content",
386+
"expression" : "{'messages': [{'role': 'assistant', 'content': 'I am a parrot'}]}",
386387
"widget" : "aichat"
387388
}
388389
```
389390
## aichat widget
390-
chat widget that allows you to react to user inputs and file uploads. this example chats with OpenAI's gpt-4o-mini model. The API key must be provided using the 'openai' credentials in the function catalog. The onChat callback passes messages (the chat history) and the new user query to the $chat function. The widget is configured using 'expression'. This expression specifies the initial messages - in this case the system message containing the system prompt
391+
chat widget that allows you to react to user inputs and file uploads. this example calls a AIApp function called aia
391392
```json
392393
{
393-
"onChat" : "/* called when a new question is entered in the chat */\n$chat('https://api.openai.com/v1/chat/completions', query, messages, [], {'model':'gpt-4o-mini'}, {'Authorization': 'openai', 'dj-timeout-seconds': 60})",
394-
"expression" : "/* initial chat state with system prompt in messages */\n{'messages': [{'role': 'system', 'content': 'always answer in a funny way'}]}",
394+
"onChat" : "$sse('aia', $append(messages, newMessage))",
395395
"widget" : "aichat"
396396
}
397397
```
398-
onChat
399-
```
400-
/* called when a new question is entered in the chat */
401-
$chat('https://api.openai.com/v1/chat/completions', query, messages, [], {'model':'gpt-4o-mini'}, {'Authorization': 'openai', 'dj-timeout-seconds': 60})
402-
```
403-
expression
404-
```
405-
/* initial chat state with system prompt in messages */
406-
{'messages': [{'role': 'system', 'content': 'always answer in a funny way'}]}
407-
```
408398
## analytics widget
409399
displays the results of a SQL query as a chart or table. Allows placing filters on the widget that the user can set when viewing the widget. The database, table, columns, and filter fields determine the SQL query: in this case, it is 'select user, count(ID) from REQUESTS where submitted >= ?' on the database 'sqlite'. Possible filter input widgets are: text, slider, switch, date, select, and selectmultiple.
410400
```json

dashjoin-docs/llms/function.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,23 @@
9191
"password": "DJ1#\b7Zw3EGtmVKaDuwwOtwXfWDG1y+awbon7WNQp9NmJ6EgUXEpYUMC8O7zRUw2kSnDxyATO0R3ke3NxjaT9zCwYyDGS5VDgYt/L",
9292
"apiKey": true
9393
}
94+
},
95+
{
96+
"title": "AIApp",
97+
"description": "Configures an AI application with system prompt, tools, and RAG",
98+
"file": "model/dj-function/aia.json",
99+
"code": {
100+
"ID": "aia",
101+
"djClassName": "com.dashjoin.ai.AIApp",
102+
"systemPrompt": "You are a helpful assistant",
103+
"tools": [
104+
"time:get_current_time"
105+
],
106+
"model": "mistral",
107+
"documents": [
108+
"rag.txt"
109+
]
110+
}
94111
}
95112
]
96113
}

llms.txt

Lines changed: 46 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -374,19 +374,19 @@ CODE: {
374374
}
375375

376376
TITLE: aichat widget
377-
DESCRIPTION: chat widget that allows you to react to user inputs and file uploads. this example answers (without AI) by simply repeating what the user asks.
377+
DESCRIPTION: chat widget that allows you to react to user inputs and file uploads. this example answers (without AI) by simply repeating what the user asks. the chat is initialized with a simple message
378378
LANGUAGE: json
379379
CODE: {
380-
"onChat" : "$append(messages, [{'role':'user', 'content': query}, {'role':'assistant', 'content': 'you said: ' & query}])",
380+
"onChat" : "newMessage.content",
381+
"expression" : "{'messages': [{'role': 'assistant', 'content': 'I am a parrot'}]}",
381382
"widget" : "aichat"
382383
}
383384

384385
TITLE: aichat widget
385-
DESCRIPTION: chat widget that allows you to react to user inputs and file uploads. this example chats with OpenAI's gpt-4o-mini model. The API key must be provided using the 'openai' credentials in the function catalog. The onChat callback passes messages (the chat history) and the new user query to the $chat function. The widget is configured using 'expression'. This expression specifies the initial messages - in this case the system message containing the system prompt
386+
DESCRIPTION: chat widget that allows you to react to user inputs and file uploads. this example calls a AIApp function called aia
386387
LANGUAGE: json
387388
CODE: {
388-
"onChat" : "/* called when a new question is entered in the chat */\n$chat('https://api.openai.com/v1/chat/completions', query, messages, [], {'model':'gpt-4o-mini'}, {'Authorization': 'openai', 'dj-timeout-seconds': 60})",
389-
"expression" : "/* initial chat state with system prompt in messages */\n{'messages': [{'role': 'system', 'content': 'always answer in a funny way'}]}",
389+
"onChat" : "$sse('aia', $append(messages, newMessage))",
390390
"widget" : "aichat"
391391
}
392392

@@ -912,6 +912,16 @@ CODE: {
912912
}
913913
}
914914

915+
TITLE: KnowledgeBase
916+
DESCRIPTION: Expose the RAG document knowledge base to the platform
917+
LANGUAGE: json
918+
CODE: {
919+
"ID" : "dj/kb",
920+
"name" : "kb",
921+
"djClassName" : "com.dashjoin.ai.KnowledgeBase",
922+
"url" : "http://localhost:8001"
923+
}
924+
915925
TITLE: Invoke
916926
DESCRIPTION: Function that adds two numbers passed in the argument object. It can be called via $call('add') or via REST
917927
FILE: model/dj-function/add.json
@@ -989,6 +999,32 @@ CODE: {
989999
"password" : "DJ1#\btW06MCaBJjnRvgvGgTaTpQ=="
9901000
}
9911001

1002+
TITLE: MCPServer
1003+
DESCRIPTION: Configures an MCP server
1004+
FILE: model/dj-function/mcp.json
1005+
LANGUAGE: json
1006+
CODE: {
1007+
"djClassName" : "org.dashjoin.function.MCPServer",
1008+
"ID" : "mcp",
1009+
"url" : "https://mcp.notion.com/mcp",
1010+
"username" : "Authorization",
1011+
"password" : "DJ1#\b7Zw3EGtmVKaDuwwOtwXfWDG1y+awbon7WNQp9NmJ6EgUXEpYUMC8O7zRUw2kSnDxyATO0R3ke3NxjaT9zCwYyDGS5VDgYt/L",
1012+
"apiKey" : true
1013+
}
1014+
1015+
TITLE: AIApp
1016+
DESCRIPTION: Configures an AI application with system prompt, tools, and RAG
1017+
FILE: model/dj-function/aia.json
1018+
LANGUAGE: json
1019+
CODE: {
1020+
"ID" : "aia",
1021+
"djClassName" : "com.dashjoin.ai.AIApp",
1022+
"systemPrompt" : "You are a helpful assistant",
1023+
"tools" : [ "time:get_current_time" ],
1024+
"model" : "mistral",
1025+
"documents" : [ "rag.txt" ]
1026+
}
1027+
9921028
TITLE: login configuration
9931029
DESCRIPTION: Login configuration for ACME Corp. App with a specific login screen background image. Users can choose between the 'de' and 'en' locales. The default is the browser locale.
9941030
FILE: assets/logincfg.json
@@ -1307,6 +1343,11 @@ DESCRIPTION: Lookup the text in the translation file and return the match for th
13071343
LANGUAGE: jsonata
13081344
CODE: $translate('ra.action.select_all_button')
13091345

1346+
TITLE: sse
1347+
DESCRIPTION: Calls the AIApp function called aia with messages. Use only in the AIChat widget's onChat expression
1348+
LANGUAGE: jsonata
1349+
CODE: $sse('aia', [{'role': 'user', 'content': 'hi there'}])
1350+
13101351
TITLE: create
13111352
DESCRIPTION: create a new record in database 'sqlite', table 'REQUESTS'
13121353
LANGUAGE: jsonata

0 commit comments

Comments
 (0)