Logseq supports some of org mode syntax.
ai = openai.AsyncOpenAI(base_url="http://localhost:8080/v1", api_key="sk-no-key-required")
response = await ai.chat.completions.create(
messages=[
{"role": "system", "content": "..."}, {"role": "user", "content": "..."},
],
max_tokens=100,
model="Llama-3.2-1B-Instruct.Q6_K.gguf",
)
content = response.choices[0].message.content wget https://huggingface.co/Mozilla/Llama-3.2-1B-Instruct-llamafile/resolve/main/Llama-3.2-1B-Instruct.Q6_K.llamafile
chmod +x Llama-3.2-1B-Instruct.Q6_K.llamafile
./Llama-3.2-1B-Instruct.Q6_K.llamafile --server from django.db import models
from django.db import connection
class MyModel(models.Model):
name = models.CharField(max_length=255)
class Meta:
app_label = 'myapp'
with connection.schema_editor() as schema_editor:
schema_editor.create_model(MyModel)
# from django.core.management import call_command
# call_command('makemigrations', 'myapp')
# call_command('migrate', 'myapp') #!/usr/bin/env xonsh
"""
$> ok android shell
$> ok android ssh
$> ok android sshd
$> ok android sms
"""
import fire as _fire
class android:
ip = '...;
def shell(self):
adb connect f'{self.ip}:5555'
adb shell
def sshd(self):
adb connect f'{self.ip}:5555'
adb shell input keyevent 26
adb shell input swipe 500 800 500 300 200
sleep 1
adb shell am start -n com.termux/.app.TermuxActivity
adb shell input text "sshd"
adb shell input keyevent 66
adb shell input text "exit"
adb shell input keyevent 66
def ssh(self):
ssh -p 8022 f'user@{self.ip}'
def sms(self):
result = $(ssh -p 8022 f'user@{self.ip}' termux-sms-list -l 20 | jq ".[].body")
print(result)
def long_echo(): print(result)
@(long_echo) | llm -m llama3 -s 'please translate messages to English, quote the original messages too'
if __name__ == '__main__':
_fire.Fire()