Mostly Transmissions Today
Main things:
- AI support
- Refactor #Transmissions
- Tidy up #Postcraft
- FOAF video recovery
AI Support
The other day I had a play with LibreChat, which is a chatbot frontend that can be connected to a range of AI services. I got it running on my local machine, have done a git pull and have been adding services.
From Known Endpoints in librechat.example.yaml :
- AnyScale
- API Pie
- Fireworks
- GROQ
- HuggingFace
- Mistral AI
- OpenRouter
- Perplexity - requires payment first
- Shuttle AI
- Together AI
I've added API keys for those to my .env. (Don't forget to include it in the .gitignore before committing!)
Listed in the endpoints but weren't in the sample .env, I've also added:
- Cohere
- DataBricks - wasn't obvious where to get the API key, left for now
to be continued...
It also supports RAG, and somewhere it mentions using HuggingFace for embeddings. So also in my .env:
RAG_API_URL=http://host.docker.internal:8000
EMBEDDINGS_PROVIDER=huggingface
HF_TOKEN=...
danny@danny-desktop:~/AI/LibreChat$ docker compose ls
danny@danny-desktop:~/AI/LibreChat$ docker compose up -d
Hmm. It doesn't appear to be picking up the new .env settings, even after docker compose . Try again later.
Tidy up Postcraft
The Transmissions refactoring might take a while, and will no doubt break the setup for Postcraft in the interim. So I'll do a quick tidy up there first, publish the current material.
ok, 2024-04-27_postcraft-flow.md says:
./run postcraft /home/danny/HKMS/postcraft/danny.ayers.name
I guess that'll be from danny@danny-desktop:~/HKMS/transmissions$ - the terminal I have in #Cursor.
Ok, that appears to have run ok. Stuff locally at http://localhost/danny.ayers.name/public/blog/
I'll push those changes, then do a quick check of https://danny.ayers.name/
It's there, but without the CSS.
<link rel="stylesheet" href="css/fonts.css" type="text/css" />
Need more coffee!!
Ok, so with :
./run postcraft /home/danny/HKMS/postcraft/danny.ayers.name
it's picking up :
/home/danny/HKMS/transmissions/src/applications/postcraft
./about.md
./services.ttl
./transmission.ttl
and then applying that to :
/home/danny/HKMS/postcraft/danny.ayers.name/manifest.ttl
putting the result in :
danny@danny-desktop:~/HKMS/postcraft/danny.ayers.name/public/blog$ ls
entries index.html
I don't like ./blog there, ./home would be better.
what it needs to do but I clearly haven't set up yet is to copy some of this across :
danny@danny-desktop:~/HKMS/postcraft/danny.ayers.name/layouts/mediocre$ ls
about.md css fonts layout-sample.html templates
So this is delegation to the max, but that's ok, intentional separation of concerns.
I forget what Transmissions services (in transmissions/src/services/) I've got set up around copy, one might need to be tweaked/added.
It'll be easiest to run at the start of the pipeline, before things start forking.
That will take its config from transmissions/src/applications/postcraft/services.ttl. Which in turn (I think) should take its details from the manifest.ttl in the site directory.
I'll need to check what is in place already. While I'm at it, I want to tweak the content folders a bit. New version in docs/site-template.md.
Ok, so in danny.ayers.name/manifest.ttl I've flipped blog to home and added :
# STYLES ETC
t:CSS a pc:StaticGroup ;
pc:site <https://danny.ayers.name> ;
fs:sourceDirectory "layouts/mediocre/css" ;
fs:targetDirectory "public/home/css" .
... similar for fonts & JS
also need to clean dirs on rebuild - later
Although I've got a FileReader and a FileWriter, I don't have a FileCopy. I'll add one to the services.
Shortly...
I'll put the config in place in service.ttl now, then implement it after a bit of Transmissions refactoring, after dogwalk.
Hmm. I can't remember how I did the delegaty bit. For now I've put this in services.ttl as a placeholder :
t:copyCSS a trm:FileCopy ;
trm:key t:cssCopy .
... similar for fonts & JS
Yay! I got the change from execute(data, context) to execute(context) etc. done and it's working with the postcraft application. I was dreading that. It may have broken some of the other services, but no biggy, I'll find out as I go along.
I guess I should also rename the mill dir to engine while I'm at it. Done! That was surprisingly painless too.
So, FileCopy service. I also need a FileRemove service nearbly, so I might as well set that up too.
Prompt time.
Using @ServiceExample.js as a template, create @FileCopy.js The context object going into execute(context) will have source and destination keys. The source will be a path to a file or directory, the destination will be a path to a directory. If source is a file, it will be copied to the destination directory. If source is a directory, the directory and its contents will be copied recursively to the destination directory. Include appropriate error handling.
Using @ServiceExample.js as a template, create @FileRemove.js The context object going into execute(context) will have a remove key. This will be a path to a file or directory. If it is a file, that file will be deleted. If it is a directory, the directory's contents will be deleted recursively, but not the directory itself. Include appropriate error handling.
Ok, they're sketched out and I've started a little application file-copy-remove-test to try them out.
Enough for today.