Skip to content

Instantly share code, notes, and snippets.

@donbr
donbr / einar_and_the_bear_draft.md
Last active May 19, 2024 09:36
Einar and the Bear - Draft

Einar and the Bear - Draft

Prologue: The Pact of Shadows and Light

Before the village of Einar lay under the watchful protection of the Spirit Bear, before the forest whispered secrets through the snow, and before Einar became known as the Bear Slayer, there was a pact—a covenant between the ancient spirits of the forest and the first settlers of the land. This pact was born from necessity, a mutual understanding that for both to thrive, a balance must be maintained.

In the time when the world was younger, when the trees stretched so high they seemed to touch the sky, and the spirits roamed freely among the living, the first villagers sought to make their home at the forest's edge. They understood the sanctity of the land, the sacredness of the woods that teemed with life and ancient magic. In their wisdom, they knew that to live in harmony with such a force, a pact must be made.

The elders of the village, guided by dreams sent by the forest spirits, ventured deep into the heart of the woods, to a c

@donbr
donbr / yt-email-reply-llama3-crewai-groq.ipynb
Last active April 22, 2024 17:19
yt-email-reply-llama3-crewai-groq.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@donbr
donbr / README.md
Created April 18, 2024 16:13 — forked from disler/README.md
Use these Prompt Chains to build HIGH QUALITY AI Agents (Agentic Building Blocks)

Setup

  1. Create a new directory with these three files (requirements.txt, main.py, README.md)
  2. python -m venv venv
  3. source venv/bin/activate
  4. pip install -r requirements.txt
  5. python main.py
  6. Update main() to run the example prompt chains
@donbr
donbr / langchain_rag_from_scratch.md
Last active April 29, 2024 10:48
RAG from Scratch
@donbr
donbr / rag_from_scratch_playlist.json
Created April 2, 2024 19:37
rag_from_scratch_playlist
{
"kind": "youtube#playlistItemListResponse",
"etag": "4oVDxXOqlyaVnRrnJXuhwXPhMSg",
"items": [
{
"kind": "youtube#playlistItem",
"etag": "bh6WIsa4tB6e6DgavMaPsvdBOOA",
"id": "UExmYUlERkVYdWFlMkxYYk8xX1BLeVZKaVEyM1p6dEEweC41NkI0NEY2RDEwNTU3Q0M2",
"snippet": {
"publishedAt": "2024-02-06T01:10:40Z",
from langchain.chat_models import ChatOpenAI
from langchain.prompts import ChatPromptTemplate
from langchain.schema.output_parser import StrOutputParser
import requests
from bs4 import BeautifulSoup
from langchain.schema.runnable import RunnablePassthrough, RunnableLambda
from langchain.utilities import DuckDuckGoSearchAPIWrapper
import json
RESULTS_PER_QUESTION = 3
@donbr
donbr / langchain_ollama_image_summarization.ipynb
Created January 23, 2024 22:57
Ollama models - Image Summarization
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@donbr
donbr / langchain_openai_image_summarization.ipynb
Last active January 23, 2024 22:49
OpenAI models - Image Summarization
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@donbr
donbr / langchain_vertexai_image_summarization.ipynb
Last active January 28, 2024 07:37
Vertex AI Models - Image Summarization
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.