Expression | How to Read This |
---|---|
a plus b | |
a minus b | |
a times b | |
a over b | |
a is greater than b | |
a is less than b |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from txtai import Embeddings, LLM | |
# Data to index | |
data = [ | |
"US tops 5 million confirmed virus cases", | |
"Canada's last fully intact ice shelf has suddenly collapsed, forming a Manhattan-sized iceberg", | |
"Beijing mobilises invasion craft along coast as Taiwan tensions escalate", | |
"The National Park Service warns against sacrificing slower friends in a bear attack", | |
"Maine man wins $1M from $25 lottery ticket", | |
"Make huge profits without work, earn up to $100,000 a day" |
Custom instruction to make Claude Artifacts use persistent and distinct file identifiers in Projects
- The
title
attribute of the<AntArtifact>
XML tag becomes thefile_name
attribute when 'Add to Project' is clicked. - Since Claude defaults to a human-readable
title
(e.g. "Modified Web Page With New Features"), this will tend to change the filename in the Project - It's easier to keep a single file copy in your Project docs ("Project Knowledge") when the file names are persistent in this way
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# t - The missing LLM token counting and splitting tool for UNIX | |
import argparse | |
import sys | |
from typing import Optional, List | |
import math | |
import os | |
import tiktoken |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<artifacts_info> | |
The assistant can create and reference artifacts during conversations. Artifacts are for substantial, self-contained content that users might modify or reuse, displayed in a separate UI window for clarity. | |
# Good artifacts are... | |
- Substantial content (>15 lines) | |
- Content that the user is likely to modify, iterate on, or take ownership of | |
- Self-contained, complex content that can be understood on its own, without context from the conversation | |
- Content intended for eventual use outside the conversation (e.g., reports, emails, presentations) | |
- Content likely to be referenced or reused multiple times |
- API: https://github.com/ollama/ollama/blob/main/docs/api.md
- Docker: https://github.com/ollama/ollama/blob/main/docs/docker.md
- Ollama docker-compose + UI: https://github.com/mythrantic/ollama-docker
Warning
Running from a docker container in MacOS M3 with GPUs won't work from Docker
Sequential prompt chaining in one method with context and output back-referencing.
main.py
- start here - full example usingMinimalChainable
fromchain.py
to build a sequential prompt chainchain.py
- contains zero library minimal prompt chain classchain_test.py
- tests forchain.py
, you can ignore thisrequirements.py
- python requirements
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<artifacts_info> | |
The assistant can create and reference artifacts during conversations. Artifacts are for substantial, self-contained content that users might modify or reuse, displayed in a separate UI window for clarity. | |
# Good artifacts are... | |
- Substantial content (>15 lines) | |
- Content that the user is likely to modify, iterate on, or take ownership of | |
- Self-contained, complex content that can be understood on its own, without context from the conversation | |
- Content intended for eventual use outside the conversation (e.g., reports, emails, presentations) | |
- Content likely to be referenced or reused multiple times |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" | |
-- Toggle Nvim Tree with Ctrl+b | |
vim.api.nvim_set_keymap("n", "<C-b>", ":NvimTreeToggle<CR>", {noremap = true, silent = true}) | |
-- Use telescope with Ctrl+p | |
vim.api.nvim_set_keymap("n", "<C-p>", ":Telescope find_files<CR>", {noremap = true, silent = true}) | |
-- Toggle Copilot Chat with Ctrl+c | |
vim.api.nvim_set_keymap("n", "<C-c>", ":CopilotChatToggle<CR>", {noremap = true, silent = true}) | |
-- Rename using LSP in normal mode |