-
Setup AI locally by Ollama
2024-02-21 02:04With the release of SiYuan 3.0.0 we can now set the LLM to use. This makes the setup trivial. For example I downloaded
dolphin-mixtral
using ollama by running:ollama run dolphin-mixtral
after downloading the weights simply run
ollama serve
or open the ollama app.
In SiYuan you set the model you just downloaded as OpenAI and your localhost as the server
dolphin-mixtral is quite large so you will need a powerfull computer. A model I can recommend for faster inference/less powerful machines is Microsoft's Phi-2:
-
Guides and tutorials on SiYuan plugin development?
2024-02-19 04:55There is
but there do not seem to be a lot of English docs yet.
Also check out
As @zuoqiu makes extremely nice add-ons
-
Setup AI locally by Ollama
2024-02-09 07:08Ollama is now OpenAI compatible by itself so the setup should be easier
-
New to Siyuan
2024-02-09 07:04I found the User guide within the app best. See settings➡️ help. Post here if something remains unclear. :)
-
Where is database table in SiYuan Android apps?
2024-01-18 04:04I think it's been revised to mid February
-
Where is database table in SiYuan Android apps?
2024-01-16 05:19Yes PRO users can use databases. Here is an example that has a relation column with its own primary key and counts the number of relations that have checked boxes.
-
Reduce Cloud Storage Amount
2024-01-05 16:56Thank you! Just to clarify, to safely manually delete the cloud snapshots I would just make sure I have the latest changes on a machine, delete the data in the s3 bucket and reupload from that machine. Are the other machines automatically going sync to that "new" snapshot and forget about the previous cloud state without problems (I am worried about an inconsitent data state where other machines expect particular snapshots to exist or there is some kind of dependency between them that the "new" snapshot is obviously unaware of)?
-
How do you get backlink references to show in the Siyuan App?
2024-01-04 22:43The duplicates for me seem to be due to nested blocks. We can explicitly only select blocks if their parent is not already selected (this will give you the outer most block, you can flip
parent_id
andid
in the second where clause to get the inner most blocks. In addition, I sepcifically exclude super blocks since they do not contain any content other than another block (I hope that is correct, @88250?) which will be included in the output already if it contains a link to the current page. Putting the following in the folderdata/templates
(within your SiYuan directory) e.g. asbacklinks.md
will create a template to insert a query for backlinks to the current document automatically:{{WITH cands AS (SELECT * FROM blocks WHERE markdown LIKE '%((.action{.id} %))%') SELECT * FROM cands WHERE parent_id NOT IN (SELECT id FROM cands) AND type != 's'}}
-
How do you get backlink references to show in the Siyuan App?
2024-01-04 06:37Try adding
AND type = 'p'
(see documentation for advanced search - type filtering for additional parameters)If you want to select multiple types try
AND type in ('p', 'h', 'd')
for documents, headings and paragraphs -
How do you get backlink references to show in the Siyuan App?
2024-01-03 23:25There is an icon that will open the backlinks panel when clicked:
For me it's in the lower right but not sure if I moved it. To query only backlinks to the current document (and not blocks within it) I have a template
{{SELECT * FROM BLOCKS WHERE markdown like '%((.action{.id}%))%'}}
-
SQL query with JavaScript
2024-01-03 23:15The template to query the current document
{{SELECT * FROM BLOCKS WHERE root_id = '.action{.id}'}}
-
Add block via iOS share menu
2024-01-02 00:40I also managed to create a "read later" implementation that seems to work great.
the data type is set to "dom" here
-
Add block via iOS share menu
2024-01-01 09:10For others who are interested, I hacked something together using iOS Shortcuts. One can send POST requests via Shortcuts so the API can be used.
The shortcut works as follows
- "Set Variable": select variable name (e.g., block) and select "to Shortcut Input"
- Select receive input from Share Sheet and Ask For Text if there is no input in the step that spawns above
- Open Siyuan
- Get Contents of
http://127.0.0.1:6806/api/block/insertBlock
set method to post, headers add key Content-Type and value application/json, set data to the variable created above, dataType: markdown and previousID to the block above the one that is inserted
There is an option to show shortcuts in the share menu
-
SQL query with JavaScript
2023-12-31 20:14Just playing around with this a bit:
//!js const query_path = async (path) => { let notebooks_ = await fetchSyncPost("/api/notebook/lsNotebooks"); let notebooks = notebooks_.data.notebooks; // Identify your notebook name: let myNb = notebooks.filter((nb) => nb.name.includes("Notes")); let myId = myNb[0].id; let blocks = await fetchSyncPost("/api/filetree/getIDsByHPath", {path: path, notebook: myId}); return blocks.data } return query_path("/Resources/PC/Python")
-
SQL query with JavaScript
2023-12-31 19:41Thank you for the hint! I did get a minimal example going based on this comment in the GH issue.
It appears that the
//!js
blocks want a list of IDs as return value. The simplest possible example is://!js return ["20231229141513-pnebh92"]
However, we can query the API using the following code and return a list of IDs returned by it:
//!js const query = async () => { let blocks = await fetchSyncPost("/api/block/getChildBlocks", {id: "20231229141511-fh9y9hc"}); let data = blocks.data; let ids = data.map((d) => {return d.id}); return ids } return query()