Skip to content

Instantly share code, notes, and snippets.

View dirkliebich's full-sized avatar

Dirk Liebich dirkliebich

View GitHub Profile
@dirkliebich
dirkliebich / gist:27ce91963731341a7863e49c30c727cd
Created January 10, 2025 14:22
PTV Logistics - Create Route
# We have several addresses and need a routing plan that provides the fastest path to all places
# for a single driver.
#
# The code below should do just that but we find access errors?
#
# Loaded addresses: [{'id': '1', 'address': 'Diercksenstrasse 51'}, {'id': '2', 'address': 'Nibelungenstraße 59'}, {'id': '3', 'address': 'Tiergartenstrasse 48a'}]
# Geocoding: Diercksenstrasse 51
# Geocoding: Nibelungenstraße 59
# Geocoding: Tiergartenstrasse 48a
Understand the Task: Grasp the main objective, goals, requirements, constraints, and expected output.
- Minimal Changes: If an existing prompt is provided, improve it only if it's simple. For complex prompts, enhance clarity and add missing elements without altering the original structure.
- Reasoning Before Conclusions: Encourage reasoning steps before any conclusions are reached. ATTENTION! If the user provides examples where the reasoning happens afterward, REVERSE the order! NEVER START EXAMPLES WITH CONCLUSIONS!
- Reasoning Order: Call out reasoning portions of the prompt and conclusion parts (specific fields by name). For each, determine the ORDER in which this is done, and whether it needs to be reversed.
- Conclusion, classifications, or results should ALWAYS appear last.
- Examples: Include high-quality examples if helpful, using placeholders [in brackets] for complex elements.
- What kinds of examples may need to be included, how many, and whether they are complex enough to benefit from p
@dirkliebich
dirkliebich / prompts.md
Last active August 5, 2024 18:08
Prompts

You are tasked with creating a name tag-like display for a given text. Your job is to evaluate the content and present key information in a visually organized manner. Follow these instructions carefully:

  1. Read and analyze the following text:
{{TEXT}}
  1. Extract and categorize the following information from the text: a. Sentiment: Determine if the overall sentiment is negative, positive, or neutral.
@dirkliebich
dirkliebich / deepgram_ttt.py
Last active June 18, 2024 14:42
deepgramm (text to text)
from deepgram import DeepgramClient, PrerecordedOptions, AnalyzeOptions
DEEPGRAM_API_KEY = "c54089a7b3d72c96a9f880d9e3a00aaf26322021"
TEXT = {
"buffer": "Enter your text here."
}
def dg_ttt():
@dirkliebich
dirkliebich / Building AV Capture Objects.ipynb
Created March 4, 2024 07:07 — forked from benhoyle/Building AV Capture Objects.ipynb
Building Audio/Video Capture Objects
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dirkliebich
dirkliebich / vid.py
Created February 19, 2024 20:45
jump_video
import streamlit as st
data = "video.mp4"
st.write("Click to go to that moment in video.")
time_stamps = [
(st.button("Part A", "a"), 1), # bool, moment (seconds)
(st.button("Part B", "b"), 20),
(st.button("Part C", "c"), 40),
@dirkliebich
dirkliebich / fishial.py
Created February 3, 2024 21:49
fishail models
import os
import requests
def download_models():
# Create MODELS folder if it doesn't exist
if not os.path.exists('../com.docker.devenvironments.code/MODELS'):
os.makedirs('../com.docker.devenvironments.code/MODELS')
# Dictionary of URLs and corresponding filenames
urls = {
@dirkliebich
dirkliebich / chromadb-sum.py
Last active December 4, 2023 17:55
chromadb-sum
"""
Filename: /home/dirk/dev/iCUE/iCUE-SmartScribe/langchain_sum.py
Path: /home/dirk/dev/iCUE/iCUE-SmartScribe
Created Date: Friday, April 21st 2023, 2:20:37 pm
Author: Dirk Liebich
Copyright (c) 2023 iCUE Solutions GmbH
"""
import os
import glob
@dirkliebich
dirkliebich / chromadb.py
Created October 18, 2023 09:31
chromadb
'''
Filename: /home/dirk/dev/iCUE/iCUE-SmartScribe/langchain.py
Path: /home/dirk/dev/iCUE/iCUE-SmartScribe
Created Date: Monday, April 24th 2023, 12:37:32 pm
Author: Dirk Liebich
Copyright (c) 2023 iCUE Solutions GmbH
Example
https://github.com/hwchase17/langchain/issues/2491
@dirkliebich
dirkliebich / tiktoken
Last active October 7, 2023 12:12
Token count for embedding
# FILEPATH: /tiktoken
import tiktoken
def num_tokens_from_string(string: str, encoding_name: str) -> int:
"""
Returns the number of tokens in a text string.
Args:
string (str): The text string to count tokens in.
encoding_name (str): The name of the encoding to use.