Skip to content

Instantly share code, notes, and snippets.

/**
* This is a version of a tool-calling behavior that implements a "phased scenario" style prompt
* for restaurant selection and reservation. The conversational agent guides the user through
* selecting a restaurant and making a reservation based on their preferences in phases.
*/
import { defineTool } from "@pioneersquarelabs/language-barrier";
import { defineBehaviorModule } from "@pioneersquarelabs/vdot";
import { z } from "zod";
/**
__________________START o1______________________
**Plan to Address GitHub Issue: Add Research Component to Dashboard Workspace**
---
### 1. Understand the Problem
- **Objective**: Add a new "Research" component to the dashboard application to display research items associated with a specific task or issue.
- **Key Requirements**:
import {
defineBehaviorModule,
defineTool,
createVdotMachine,
sendMessage,
Content,
} from "@pioneersquarelabs/vdot";
import { z } from "zod";
// Define the weather tool
@kleneway
kleneway / gist:bdfbdd82d07ab80dadb9bcfb5c3a5fef
Created April 30, 2024 16:30
JACoB conversational prompt
Act as a remote junior software developer named Jacob who has been tasked with gathering requirements from a client to write up a new GitHub issue for the development team to implement. Jacob is a little bit quirky and funny, and he has a lot of respect and admiration for the client. This specific client is his favorite to work with, and he wants to make sure they have a great experience while also getting all the information needed for the GitHub issue write-up.
Your job is to have a very short, concise, friendly conversation with the client to elicit all the key details needed for the GitHub issue write-up. The issue write-up should allow another developer to fully understand the scope and requirements without needing any additional information.
Engage in the conversation using the following phases:
Phase 1: Introduction
Greet the client in a friendly manner. Explain that you will be asking them a series of questions to understand their requirements for a new software feature or bug fix. Let them know
@kleneway
kleneway / prompt.js
Created February 18, 2023 17:43
Prompt Example
const inputTopic = "How to care for orchids";
const prompt = `
interface WritingMindMap {
topic: string;
l1: {
name: string;
l2: {
name: string;
details: string;
uniqueInsight?: string;
/*jshint esversion: 6 */
var axios = require("axios");
// FOR ASSISTS
const NAMES = [
"Devin Booker",
"Khris Middleton",
"Giannis Antetokounmpo",
"Jrue Holiday",
"use strict";
const cors = require("cors");
const express = require("express");
const smartcar = require("smartcar");
const app = express().use(cors());
const port = 8000;
const client = new smartcar.AuthClient({
@kleneway
kleneway / gist:6171650
Created August 7, 2013 06:14
Example of drawing a pie chart slice from Haiku Deck using Core Graphics
- (UIBezierPath*)slicePathForDataPoint:(DataPoint*)dataPoint forCompleted:(float)completed forTotal:(float)total {
if(!total) {
return nil;
}
float percentOfTotal = (completed+fabsf([dataPoint.number floatValue]))/total;
float percentCompleted = completed/total;
percentOfTotal *= self.animationScaleFactor;
percentCompleted *= self.animationScaleFactor;
@kleneway
kleneway / gist:6171372
Created August 7, 2013 05:10
Using NSLinguisticTagger to stem Haiku Deck tags
// use the built-in ios linguistics functionality to stem the tags
+ (NSMutableArray *)stemTags:(NSMutableArray*)originalTags {
NSLinguisticTagger *tagger = [[NSLinguisticTagger alloc]
initWithTagSchemes:[NSArray arrayWithObjects:NSLinguisticTagSchemeLemma, nil]
options:(NSLinguisticTaggerOmitWhitespace | NSLinguisticTaggerOmitPunctuation)];
NSMutableArray *stemmedTags = [[NSMutableArray alloc] init];
// convert tags to string
[tagger setString:[originalTags componentsJoinedByString:@" "]];
@kleneway
kleneway / gist:6171311
Created August 7, 2013 04:58
UIPanGestureRecognizer for creating parallax effect on an image view with text view
- (IBAction)handlePanGesture:(UIPanGestureRecognizer*)gesture
{
CGPoint translation = [gesture translationInView:self.view];
if (gesture.state == UIGestureRecognizerStateChanged) {
// user is swiping, translate the view for the image by 1/4 the translation, and the text by 1/2 the translation to give parallax effect
self.currentSlide.imageView.frame = CGRectMake(self.currentSlide.imageView.frame.origin.x+translation.x/4,0,self.currentSlide.imageView.frame.size.width, self.currentSlide.imageView.frame.size.height);
self.currentSlide.slideText.view.frame = CGRectMake(self.currentSlide.slideText.view.frame.origin.x+translation.x/2,0,self.currentSlide.slideText.view.frame.size.width, self.currentSlide.slideText.view.frame.size.height);
// save the cumulative translation and reset the local translation
self.panTranslation += translation.x;