Skip to content

Instantly share code, notes, and snippets.

View Yankzy's full-sized avatar

Yankuba Kuyateh Yankzy

View GitHub Profile
@Yankzy
Yankzy / dynamicForm.md
Last active June 26, 2025 09:36
Dynamic Form Rendering in Chat UI via JSON Schema

Feature: Dynamic Form Rendering in Chat UI (Local Schema, API Submission, AI Notified by Status Only)

Background

We want our AI chat assistant to trigger dynamic forms (e.g., onboarding, surveys, KYC, feedback) as part of the chat conversation. The AI will send a message with a form name (not the schema itself). The frontend will maintain a local registry of form schemas and render the appropriate form inline in the chat UI when requested. When the user submits the form, the data should be sent to the backend API (not to the AI). Only the result/status should be sent back to the AI via WebSocket.


Goal

  • Maintain a local registry of form schemas in the frontend.
  • When the AI sends a message with a form name, dynamically render the corresponding form inline in the chat UI.
@Yankzy
Yankzy / assets.json
Last active May 26, 2025 18:31
Alpaca assets
This file has been truncated, but you can view the full file.
[
{
"id": "29e95298-0ec9-4a78-bbed-96553d664d1c",
"cusip": null,
"class": "us_equity",
"exchange": "OTC",
"symbol": "VRTT",
"name": "VIATAR CTC SOLUTIONS INC Common Stock",
"status": "inactive",
"tradable": false,
@Yankzy
Yankzy / delete_gmail.md
Last active May 17, 2025 21:50
Delete Gmail Messages Older Than X Years Using Python & Gmail API

1. Set up your Google Cloud Project

  • Go to Google Cloud Console – Credentials page.
  • Select/create a project.
  • Click "+ CREATE CREDENTIALS > OAuth client ID".
  • Set Application type: Desktop app (recommended for local scripts).
  • Name it (e.g. "GmailCleanup").
  • Download the file as credentials.json.
@Yankzy
Yankzy / add_to_zshrc.sh
Created August 26, 2024 11:37 — forked from karpathy/add_to_zshrc.sh
Git Commit Message AI
# -----------------------------------------------------------------------------
# AI-powered Git Commit Function
# Copy paste this gist into your ~/.bashrc or ~/.zshrc to gain the `gcm` command. It:
# 1) gets the current staged changed diff
# 2) sends them to an LLM to write the git commit message
# 3) allows you to easily accept, edit, regenerate, cancel
# But - just read and edit the code however you like
# the `llm` CLI util is awesome, can get it here: https://llm.datasette.io/en/stable/
gcm() {
@Yankzy
Yankzy / generate_human_rights_complaint.py
Created July 28, 2024 18:43 — forked from mdear/generate_human_rights_complaint.py
Inception-based design for the AI-assisted creation of a written human rights complaint
#! /bin/env python3
""" A script to generate an Ontario Human Rights application form using GPT-4o API.
Authorship Credits: ChatGpt: 60%, Myles Dear <[email protected]>: 40%
Date last modified: Jul 11, 2024
"""
"""
Initial prompt to generate script :
@Yankzy
Yankzy / scalar.py
Created June 28, 2024 23:30
graphene custom scalar
import re
from typing import Any, Dict, List, Pattern, Type, Union
import graphene
from graphene.types import Scalar
from graphql.language import ast
class CustomScalar(Scalar):
@classmethod
def __init_subclass_with_meta__(cls, validate_pattern: str = None, **options):
@Yankzy
Yankzy / star.js
Created August 3, 2023 06:24
React Staring Component
// USING CSS
.card {
background: linear-gradient(135deg, #474c62, #383c4d);
border-radius: 12px;
box-shadow: 4px 4px 25px rgba(0, 0, 0, 0.4);
overflow: hidden;
.card-header {
color: #fbfbfc;
background: linear-gradient(135deg, #3c4256, #313747);
@Yankzy
Yankzy / sysRole.ts
Last active June 25, 2023 17:36
Control shatGPT with system role
interface ChatMessage {
role: string;
content: string;
}
export const chatOrchestrator = (
chatHistory: ChatMessage[],
setChatList: (chatList: ChatMessage[]) => void
): void => {
@Yankzy
Yankzy / message.css
Created March 22, 2023 07:25
CSS for GPTChatty
@import url("https://fonts.googleapis.com/css2?family=Alegreya+Sans:wght@100;300;400;500;700;800;900&display=swap");
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: "Alegreya Sans", sans-serif;
}
body {
@Yankzy
Yankzy / Message.js
Created March 22, 2023 07:06
message component
import React, { useContext, useEffect, useRef } from "react";
import { AuthContext } from "../context/AuthContext";
import { ChatContext } from "../context/ChatContext";
import Linkify from 'react-linkify';
const Message = ({ message }) => {
const { currentUser } = useContext(AuthContext);
const { data } = useContext(ChatContext);