Skip to content

Instantly share code, notes, and snippets.

View adambossy's full-sized avatar

Adam Bossy-Mendoza adambossy

View GitHub Profile
import json
import os
import requests
import random
import re
from reportlab.lib.pagesizes import letter
from reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer, Image, PageBreak
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.units import inch
from reportlab.lib.enums import TA_CENTER
**************************************************
Prompt Alignment Verbose Logs
**************************************************
Prompt Instructions:
[
"Correct any spelling errors, if any are present.",
"Insert missing words to ensure the story is grammatically correct.",
"Insert missing punctuation to ensure the story is grammatically correct.",
"Remove superfluous words to ensure the story is grammatically correct.",
import json
import litellm
from deepeval.metrics import PromptAlignmentMetric
from deepeval.test_case import LLMTestCase
PROOFREAD_PROMPT_INSTRUCTIONS = [
"Correct any spelling errors, if any are present.",
"Insert missing words to ensure the story is grammatically correct.",
@adambossy
adambossy / gist:8c376db63e79b9d25f1af052e7c1b589
Last active July 9, 2024 21:33
Debug logs, including sample request payload, that's resulting in intermittent 500s
[2024-07-09 19:54:39,832: DEBUG/SpawnPoolWorker-8] Request options: {'method': 'post', 'url': '/v1/messages', 'timeout': 600, 'files': None, 'json_data': {'max_tokens': 2048, 'messages': [{'role': 'user', 'content': [{'type': 'text', 'text': "You are an expert at analyzing whether the images for children's storybook illustrations are drawn correctly.\n\nThe contents of the children's storybook is:\n\nSam is a superhero champ.\r\nSam has a big red cape.\r\nSam can run very fast.\r\nSam can jump very high.\r\nSam helps a lot of pets.\r\nSam finds a lost cat.\r\nSam helps a stuck pup.\r\nSam is not a boy or girl.\r\nEveryone chants for superhero Sam.\r\nSam is a superhero champ.\n\nThe book is titled:\n\nSam, the Superhero Champ\n\nThe text of the page we are analyzing is:\n\nSam can run very fast.\r\n\nWe generated this image with the following prompt:\n\nIn the center of the bustling city street, amidst the tall buildings and busy traffic, stands Sam, the superhero champ. Sam is not a boy or girl, but a superh
https://www.affirm.com/u/loans
CURRENT PROBLEM:
d.query is not a function
parse()()/wccommo...parser.js (line 227)
parseRunner()()/wccommo...parser.js (line 240)
loaded()()loader.js (line 146)
_callLoaded()()loader.js (line 243)
_modulesLoaded()()loader.js (line 224)
_loadInit()(DOMContentLoaded )hostenv_...rowser.js (line 256)
[Break on this error] var list = d.query(qry, rootNode);
/wccommo...parser.js (line 227)