Skip to content

Instantly share code, notes, and snippets.

View itsderek23's full-sized avatar

Derek Haynes itsderek23

View GitHub Profile
@itsderek23
itsderek23 / question_accuracy_prompt.txt
Created August 1, 2023 14:45
Question Accuracy Prompt
You are given a question, the student's answer, and the true answer, and are asked to score the student answer as either CORRECT or INCORRECT.
Example Format:
QUESTION: question here
STUDENT ANSWER: student's answer here
TRUE ANSWER: true answer here
```json
{
"correct": true or false,
"why": "only include this if correct is false. explain why the student answer is incorrect"
@itsderek23
itsderek23 / open_ai_api_request.json
Created July 14, 2023 20:31
Virtual SRE Reasoning Base Prompt
{
"model": "gpt-4-0613",
"messages": [
{
"role": "system",
"content": "You are a Site Reliability Engineer. I am an engineer on your team. My questions are specific to resources we have deployed, not for the operational status of AWS services. Do not investigate the operational status of AWS services (ex: via their status page). Answer the following questions as best you can. DO NOT ANSWER QUESTIONS if they are unrelated to gathering data and making observations about AWS!\n\nHere's what I want you to do:\n\n1. Think about what you learned so far. Do this three times, in different ways. Then, pick what you think is the most accurate observation based on what you know about AWS. Do this in three sentences or less.\n\n2. ALWAYS share your plan to answer my question in 3 sentences or less without numbered steps, command names, references to arguments, and code samples. Then, call a function if needed. Your plan can only use the provided functions. You CANNOT access logs so don't inc
@itsderek23
itsderek23 / google_answer_box.rb
Created May 8, 2023 15:32
A boxcar that returns a Google answer box as JSON
# frozen_string_literal: true
require 'google_search_results'
require 'boxcars/boxcar'
require 'boxcars/result'
class GoogleAnswerBox < Boxcars::Boxcar
# The description of this boxcar. Used in the prompt to inform the engine what
# this boxcar can do.
ANSWERBOXDESC = "useful for when you need to answer questions that require realtime data." \
"You should ask targeted questions"
from flask import Flask
from flask import request
import requests
from jaeger_client import Config
from flask_opentracing import FlaskTracer
import opentracing
app = Flask(__name__)
@itsderek23
itsderek23 / Dockerfile
Created August 27, 2013 02:09
Example Docker File to start a Rails app located in a local ./docker-rails directory.
# docker build -t="rails" .
FROM ubuntu:12.04
RUN apt-get update
## MYSQL
RUN apt-get install -y -q mysql-client libmysqlclient-dev
## RUBY
# To run: ruby hello.rb
require 'sinatra'
require 'opentracing'
require 'jaeger/client'
require 'rack/tracer'
OpenTracing.global_tracer = Jaeger::Client.build(service_name: 'hello')
use Rack::Tracer
# To run: ruby hello_world.rb -p 4570
require 'sinatra'
require 'opentracing'
require 'jaeger/client'
require 'rack/tracer'
OpenTracing.global_tracer = Jaeger::Client.build(service_name: 'hello-world')
use Rack::Tracer
assets_path = File.expand_path("~/projects/rails/scout/public")
log_path = File.expand_path "~/assets.txt"
temp_requested_files_path = File.expand_path "~/processed_assets.txt"
ignore_pattern = /sparkline|datejs/
known_used =[
"javascripts/jquery-1.7.1.min.js",
"javascripts/jquery.extensions.js",
"javascripts/application.js",
"stylesheets/default.css",
@itsderek23
itsderek23 / booklet_ai_policy.json
Created March 19, 2020 21:36
Booklet.ai AWS JSON Policy
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": [
"sagemaker:ListEndpointConfigs",
"sagemaker:DescribeEndpointConfig",
"sagemaker:ListModels",