Skip to content

Commit e2623d0

Browse files
authored
Merge pull request #423 from doc4d/main
update search
2 parents 95d62d3 + 43d735c commit e2623d0

File tree

128 files changed

+2078
-932
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

128 files changed

+2078
-932
lines changed

docs/Notes/updates.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ Read [**What’s new in 4D 20 R9**](https://blog.4d.com/en-whats-new-in-4d-20-R9
2929
- New [4D AIKit component](../aikit/overview.md) enabling interaction with third-party AI APIs.
3030
- The following VP command callbacks now wait for all 4D custom functions to complete their calculations: [VP IMPORT DOCUMENT](../ViewPro/commands/vp-import-document.md), [VP IMPORT FORM BLOB](../ViewPro/commands/vp-import-from-blob.md), [VP IMPORT FROM OBJECT](../ViewPro/commands/vp-import-from-object.md), and [VP FLUSH COMMANDS](../ViewPro/commands/vp-flush-commands.md).
3131
- New [4D Netkit](https://developer.4d.com/4D-NetKit/) features to manage Google and Microsoft 365 calendars; ability to use the host web server for OAuth 2.0 authentication.
32+
- 4D Write Pro Interface: New [integrated AI](../WritePro/writeprointerface.md#integrated-ai) to interact with **chatGTP** from your 4D Write Pro documents.
3233
- [**Fixed bug list**](https://bugs.4d.fr/fixedbugslist?version=20_R9): list of all bugs that have been fixed in 4D 20 R9.
3334

3435

docs/REST/$compute.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ If you want to get all the computations for an attribute of type Number, you can
3939

4040
**Response**:
4141

42-
````
42+
```js
4343
{
4444
"salary": {
4545
"count": 4,
@@ -57,7 +57,7 @@ If you want to get all the computations for an attribute of type String, you can
5757

5858
**Response**:
5959

60-
````
60+
```js
6161
{
6262
"salary": {
6363
"count": 4,
@@ -73,7 +73,7 @@ If you want to just get one calculation on an attribute, you can write the follo
7373
7474
**Response**:
7575
76-
`235000`
76+
`335000`
7777
7878
7979
If you want to perform a calculation on an Object attribute, you can write the following:

docs/WritePro/writeprointerface.md

Lines changed: 121 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ A 4D developer can easily implement these palettes in their application. Thus, e
99

1010
The main [4D Write Pro Interface documentation](https://doc.4d.com/4Dv20/4D/20/Entry-areas.300-6263967.en.html) can be found in the *4D Design Reference manual*.
1111

12-
You will find below the Table Wizard configuration documentation.
12+
You will find below:
13+
14+
- the Table Wizard configuration documentation,
15+
- the integrated A.I. documentation.
1316

1417
## Table Wizard
1518

@@ -295,4 +298,120 @@ For every attribute used in your JSON file (header, data, carry-over, summary, a
295298

296299
#### See also
297300

298-
[4D Write Pro - Table Wizard (tutorial video)](https://www.youtube.com/watch?v=2ChlTju-mtM)
301+
[4D Write Pro - Table Wizard (tutorial video)](https://www.youtube.com/watch?v=2ChlTju-mtM)
302+
303+
304+
## Integrated AI
305+
306+
You can use an integrated AI in the 4D Write Pro interface so that you can easily translate or enhance your documents without having to use an external AI application.
307+
308+
Once you have enabled the AI feature, you can display a chat box over your 4D Write Pro document and interact with *chatGPT* to modify the text of the selection or of the document itself.
309+
310+
:::note
311+
312+
The 4D Write Pro interface uses OpenAI, for which you need to provide your own key (see below).
313+
314+
:::
315+
316+
### Limitations (Developer Preview)
317+
318+
In the current implementation, the feature has the following limitations:
319+
320+
- use of a predefined AI provider and necessity to pass your OpenAI key
321+
- basic chatting features
322+
- no image handling
323+
- non-configurable predefined action commands
324+
- predefined translations English/French and French/English only
325+
326+
327+
328+
### Enabling the AI feature
329+
330+
The AI dialog box is available by clicking on a button in the 4D Write Pro interface. This button is **hidden by default**, you need to enable it explicitely.
331+
332+
To display the AI dialog box button, you need to:
333+
334+
1. Get an API key from the [OpenAI website](https://openai.com/api/).
335+
2. Execute the following 4D code:
336+
337+
```4d
338+
339+
WP SetAIKey ("<Your OpenAI Key>") //
340+
341+
```
342+
343+
:::note
344+
345+
No checking is done on the OpenAI key validity. If it is invalid, the *chatGPT* box will stay empty.
346+
347+
:::
348+
349+
350+
The **A.I.** button is then displayed:
351+
352+
![ai button](../assets/en/WritePro/ai-button.png)
353+
354+
- in the 4D Write Pro Toolbar, in the **Import Export** tab,
355+
- in the 4D Write Pro Widget, in the **Font Style** tab.
356+
357+
Click on the button to display the AI dialog box.
358+
359+
### AI dialog box
360+
361+
The 4D Write Pro AI dialog box allows a straightforward interaction between the chat area and the 4D Write Pro document.
362+
363+
#### Prompt area
364+
365+
At the bottom of the window, the **prompt area** allows you to enter any question to send to the AI.
366+
367+
To send your question to the AI, click on the Send button:
368+
369+
![ai send](../assets/en/WritePro/ai-send.png)
370+
371+
372+
The button icon changes when the same request is sent again:
373+
374+
![ai resend](../assets/en/WritePro/ai-resend.png)
375+
376+
On the left side of this area, a pop up menu provides examples of common actions that can be usually delegated to the AI.
377+
378+
Selecting an action writes a corresponding question to the prompt. If necessary, you can modify the question and then to click on the Send button to actually send it:
379+
380+
![ai menu](../assets/en/WritePro/ai-menu.png)
381+
382+
:::note
383+
384+
Default translation actions are based upon the current 4D default configuration and depend on available languages.
385+
386+
:::
387+
388+
#### Copy buttons
389+
390+
These buttons propose basic interactions between the chat area, the underlying 4D Write Pro document, and the clipboard:
391+
392+
![ai interaction](../assets/en/WritePro/ai-interaction.png)
393+
394+
- **Return raw text**/**Return styled text**: Copy the latest response or the selected response from the AI to the 4D Write Pro document at the current insertion point, replacing the selected text if any.
395+
- **Copy raw text**/**Copy styled text**: Copy the latest response or the selected response from the AI in the clipboard.
396+
397+
In both cases, if the response was provided with styles, you can decide to copy the text with or without styles.
398+
399+
:::note
400+
401+
The chat box uses the Markdown language to format text. Basic styles such as bold, italic, underline, titles are supported. When pasting styled text from the AI in the 4D Write Pro area, you may lose some formatting information.
402+
403+
:::
404+
405+
#### Chat area
406+
407+
The Chat area displays the whole interaction between you and the AI. You can scroll and select and part you want.
408+
409+
To empty this area, you can click on the Erase button of the History area (resets the window and all interactions).
410+
411+
412+
#### History
413+
414+
The History area lists all your prompts sent to the AI. You can hide/show this area using the button on the top right corner of the Chat area.
415+
416+
The Erase button allows you to reset the whole window and erase all interactions. It is equivalent to close/reopen the AI dialog box.
417+
851 Bytes
Loading
1.55 KB
Loading
8.34 KB
Loading
1.07 KB
Loading
796 Bytes
Loading

docusaurus.config.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,13 @@ module.exports = {
131131
appId: 'OJ04C0M3CU',
132132
indexName: '4d',
133133
//contextualSearch: false
134+
//added for command search
135+
searchParameters: {
136+
advancedSyntax: true,
137+
queryType: 'prefixAll', // Priorise la chaine entiere
138+
removeWordsIfNoResults: 'allOptional', // Recherche les elements individuels si aucun resultat
139+
},
140+
// end
134141
},
135142
docs: {
136143
sidebar: {

0 commit comments

Comments
 (0)